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
3312eab5
Commit
3312eab5
authored
Jan 06, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时去掉需要判断offset的接口
parent
7038ccc6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
13 deletions
+37
-13
click_fun.py
click/views/click_fun.py
+7
-2
comment_fun.py
comment/views/comment_fun.py
+23
-10
follow_fun.py
follow/views/follow_fun.py
+7
-1
No files found.
click/views/click_fun.py
View file @
3312eab5
...
...
@@ -37,9 +37,14 @@ def click(card_info):
try
:
status
=
rpc_invoker
[
'qa/irrigation/create_answer_vote'
](
user_id
=
card_info
[
'current_user_id'
],
answer_id
=
card_info
[
'card_id'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
return
True
logging
.
info
(
"get_card_info:
%
s,create_answer_vote:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
return
True
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
comment/views/comment_fun.py
View file @
3312eab5
...
...
@@ -36,18 +36,22 @@ 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"
]
####在这里做判断 一天不能超过12个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
if
comment_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
else
:
try
:
rpc_invoker
=
get_rpc_invoker
()
status
=
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
()
answer_id
=
card_info
[
'card_id'
],
content
=
card_info
[
'comment_content'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
return
True
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
return
True
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
...
...
@@ -71,7 +75,6 @@ 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"
]
####在这里做判断 一天不能超过12个 如果超过十二个不下发 不超过 十二个下发对应的灌水功能
if
comment_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
else
:
...
...
@@ -79,9 +82,15 @@ def comment(card_info):
rpc_invoker
=
get_rpc_invoker
()
status
=
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
()
content
=
card_info
[
'comment_content'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
return
True
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
return
True
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
...
...
@@ -109,7 +118,6 @@ def comment(card_info):
comment
=
get_vest_userid_and_comment
(
need_comment_num
=
1
,
tag_names
=
card_info
[
'tag_names'
])[
0
]
card_info
[
'comment_content'
]
=
comment
####在这里做判断 一天不能超过12个 如果超过二十个不下发 不超过二十个下发对应的灌水功能
if
comment_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
else
:
...
...
@@ -120,7 +128,12 @@ def comment(card_info):
content
=
card_info
[
'comment_content'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
return
True
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
return
True
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
...
...
follow/views/follow_fun.py
View file @
3312eab5
...
...
@@ -35,8 +35,14 @@ def follow(card_info):
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
()
logging
.
info
(
"get_card_info:
%
s,user_add_follow:
%
s"
%
(
card_info
,
status
))
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
return
True
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
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