Commit 23735430 authored by lixiaofang's avatar lixiaofang

暂时去掉需要判断offset的接口

parent 9a396ded
......@@ -35,8 +35,8 @@ def click(card_info):
# send_email_tome(str(redis_data) + str(card_info))
else:
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_vote'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id']).unwrap()
status = rpc_invoker['qa/irrigation/create_answer_vote'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id']).unwrap()
return True
except:
logging_exception()
......
......@@ -36,15 +36,19 @@ def comment(card_info):
logging.info("get action:comment,card_id:%s,redis_data:%s" % (card_info['card_id'], redis_data))
comment_num = redis_data["comment"]
####在这里做判断 一天不能超过20个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
####在这里做判断 一天不能超过12个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
if comment_num > 12:
return True
# send_email_tome(str(redis_data) + str(card_info))
else:
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
try:
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
return True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
elif card_info['card_status'] == 'diary':
today = datetime.datetime.now()
......@@ -65,17 +69,19 @@ def comment(card_info):
logging.info("get action:comment,card_id:%s,redis_data:%s" % (card_info['card_id'], redis_data))
comment_num = redis_data["comment"]
####在这里做判断 一天不能超过20个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
####在这里做判断 一天不能超过12个 如果超过十二个不下发 不超过 十二个下发对应的灌水功能
if comment_num > 12:
return True
# send_email_tome(str(redis_data) + str(card_info))
else:
print("diary")
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
try:
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
return True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
else:
today = datetime.datetime.now()
str_today = str(today.year) + str(today.month) + str(today.day)
......@@ -97,21 +103,22 @@ def comment(card_info):
comment_num = redis_data["comment"]
###判断一下如果评论为空就重新拿一个
if not card_info['comment_content']:
logging.info("该ID下的评论是空的,需要重复赋值评论:%s" % card_info)
comment = get_vest_userid_and_comment(need_comment_num=1, tag_names=card_info['tag_names'])[0]
card_info['comment_content'] = comment
logging.info("该ID下的评论是空的,需要重复赋值评论:%s" % card_info)
####在这里做判断 一天不能超过12个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
if comment_num > 12:
logging.info("今天已经消费到最大次数了,不能再消费")
# send_email_tome(str(redis_data) + str(card_info))
return True
else:
rpc_invoker = get_rpc_invoker()
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
return True
try:
rpc_invoker['qa/irrigation/create_answer_reply'](user_id=card_info['current_user_id'],
answer_id=card_info['card_id'],
content=card_info['comment_content']).unwrap()
return True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
......@@ -32,8 +32,8 @@ def follow(card_info):
# send_email_tome(str(redis_data) + str(card_info))
else:
rpc_invoker = get_rpc_invoker()
rpc_invoker['api/irrigation/user_add_follow'](follow_user_id=card_info['current_user_id'],
followed_user_id=card_info['card_user_id']).unwrap()
status = rpc_invoker['api/irrigation/user_add_follow'](follow_user_id=card_info['current_user_id'],
followed_user_id=card_info['card_user_id']).unwrap()
return True
except:
......
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