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
f57a61a4
Commit
f57a61a4
authored
Jan 06, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
2eb8233f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
20 deletions
+15
-20
click_fun.py
click/views/click_fun.py
+6
-7
comment_fun.py
comment/views/comment_fun.py
+4
-6
follow_fun.py
follow/views/follow_fun.py
+5
-7
No files found.
click/views/click_fun.py
View file @
f57a61a4
...
...
@@ -30,9 +30,10 @@ def click(card_info):
logging
.
info
(
"get action:click,card_id:
%
s,redis_data:
%
s"
%
(
card_info
[
'card_id'
],
redis_data
))
click_num
=
redis_data
[
"click"
]
if
click_num
>
1
0
:
if
click_num
>
1
2
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
return
True
,
True
return
True
,
False
else
:
rpc_invoker
=
get_rpc_invoker
()
try
:
...
...
@@ -41,17 +42,15 @@ def click(card_info):
logging
.
info
(
"get_card_info:
%
s,create_answer_vote:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
and
click_num
<=
10
:
if
error
==
0
:
return
True
,
True
elif
error
==
0
and
click_num
>
10
:
return
True
,
False
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
comment/views/comment_fun.py
View file @
f57a61a4
...
...
@@ -122,7 +122,7 @@ def comment(card_info):
if
comment_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
return
True
,
Tru
e
return
True
,
Fals
e
else
:
rpc_invoker
=
get_rpc_invoker
()
...
...
@@ -133,16 +133,14 @@ def comment(card_info):
'comment_content'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,have_answer_reply:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
and
comment_num
<=
11
:
if
error
==
0
:
return
True
,
True
elif
error
==
0
and
comment_num
>
11
:
return
True
,
False
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
follow/views/follow_fun.py
View file @
f57a61a4
...
...
@@ -27,9 +27,9 @@ def follow(card_info):
logging
.
info
(
"get action:follow,card_id:
%
s,redis_data:
%
s"
%
(
card_info
[
'card_id'
],
redis_data
))
follow_num
=
redis_data
[
"follow"
]
if
follow_num
>
1
0
:
if
follow_num
>
1
1
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
return
True
,
Tru
e
return
True
,
Fals
e
else
:
rpc_invoker
=
get_rpc_invoker
()
...
...
@@ -40,16 +40,14 @@ def follow(card_info):
logging
.
info
(
"get_card_info:
%
s,user_add_follow:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
and
follow_num
<=
10
:
if
error
==
0
:
return
True
,
True
elif
error
==
0
and
follow_num
>
10
:
return
True
,
False
else
:
send_email_tome
(
str
(
card_info
)
+
str
(
status
))
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
,
Fals
e
return
False
,
Tru
e
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
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