Commit 2d02af24 authored by lixiaofang's avatar lixiaofang

add

parent 0166dfc1
...@@ -4,46 +4,42 @@ ...@@ -4,46 +4,42 @@
import time import time
import logging import logging
class GroupSortTypes(object): class GroupSortTypes(object):
# 热度排序 # 热度排序
HOT_RECOMMEND = 0 HOT_RECOMMEND=0
# 关注排序 # 关注排序
ATTENTION_RECOMMEND = 1 ATTENTION_RECOMMEND=1
class PickType(object): class PickType(object):
# 明星榜 # 明星榜
CELEBRITY_PICK = 0 CELEBRITY_PICK=0
# 帖子榜 # 帖子榜
TOPIC_PICK = 1 TOPIC_PICK=1
class TopicDocumentField(object): class TopicDocumentField(object):
""" """
帖子索引字段信息 帖子索引字段信息
""" """
ID = "id", ID="id",
IS_ONLINE = "is_online", IS_ONLINE = "is_online",
TAG_LIST = "tag_list" TAG_LIST = "tag_list"
class TopicPageType(object): class TopicPageType(object):
# 首页推荐 # 首页推荐
HOME_RECOMMEND = 1 HOME_RECOMMEND=1
# 发现页面 # 发现页面
FIND_PAGE = 2 FIND_PAGE=2
def time_consuming_decorator(func): def time_consuming_decorator(func):
def time_consuming(*args, **kwargs): def time_consuming(*args, **kwargs):
start_time = time.time() start_time = time.time()
func(*args, **kwargs) func(*args,**kwargs)
end_time = time.time() end_time = time.time()
logging.info("func consuming time:%fs" % (end_time - start_time)) logging.info("func consuming time:%fs" % (end_time-start_time))
return time_consuming return time_consuming
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment