Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
vest
Commits
23735430
Commit
23735430
authored
Jan 06, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时去掉需要判断offset的接口
parent
9a396ded
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
26 deletions
+33
-26
click_fun.py
click/views/click_fun.py
+2
-2
comment_fun.py
comment/views/comment_fun.py
+29
-22
follow_fun.py
follow/views/follow_fun.py
+2
-2
No files found.
click/views/click_fun.py
View file @
23735430
...
...
@@ -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
()
...
...
comment/views/comment_fun.py
View file @
23735430
...
...
@@ -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
())
...
...
follow/views/follow_fun.py
View file @
23735430
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment