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
88cbc05a
Commit
88cbc05a
authored
Jan 07, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'delete_have_comment' into 'master'
ask_question See merge request
!14
parents
f57a61a4
f79d0772
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
click_fun.py
click/views/click_fun.py
+0
-1
comment_fun.py
comment/views/comment_fun.py
+17
-0
No files found.
click/views/click_fun.py
View file @
88cbc05a
...
...
@@ -32,7 +32,6 @@ def click(card_info):
if
click_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
return
True
,
False
else
:
rpc_invoker
=
get_rpc_invoker
()
...
...
comment/views/comment_fun.py
View file @
88cbc05a
...
...
@@ -96,6 +96,7 @@ def comment(card_info):
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
)
...
...
@@ -120,6 +121,22 @@ 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
##在这里加一个判断 如果当前的评论的user_id和评论内容已经在这个评论下了就不再下发给同一个回答ID
else
:
key
=
'have_reply_answer_comment:'
+
str
(
card_info
[
'card_id'
])
redis_data
=
redis_client
.
hget
(
key
,
card_info
[
'current_user_id'
])
if
redis_data
:
datas
=
json
.
loads
(
redis_data
,
encoding
=
"utf-8"
)
if
card_info
[
'comment_content'
]
in
datas
:
logging
.
info
(
"当前评论和当前的用户已经存在了"
)
pass
else
:
datas
.
append
(
card_info
[
'comment_content'
])
redis_client
.
hset
(
key
,
card_info
[
'current_user_id'
],
json
.
dumps
(
datas
))
else
:
conent
=
[
card_info
[
'comment_content'
]]
redis_client
.
hset
(
key
,
card_info
[
'current_user_id'
],
json
.
dumps
(
conent
))
if
comment_num
>
12
:
logging
.
info
(
"今天已经消费到最大次数了,不能再消费"
)
return
True
,
False
...
...
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