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
bbfeae53
Commit
bbfeae53
authored
Jan 02, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增类型
parent
75e57c50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
21 deletions
+32
-21
click_fun.py
click/views/click_fun.py
+4
-3
comment_fun.py
comment/views/comment_fun.py
+18
-12
follow_fun.py
follow/views/follow_fun.py
+5
-3
consum.py
moment/views/consum.py
+4
-2
process_time.py
moment/views/process_time.py
+1
-1
No files found.
click/views/click_fun.py
View file @
bbfeae53
...
@@ -34,9 +34,10 @@ def click(card_info):
...
@@ -34,9 +34,10 @@ def click(card_info):
return
True
return
True
# send_email_tome(str(redis_data) + str(card_info))
# send_email_tome(str(redis_data) + str(card_info))
else
:
else
:
rpc_invoker
=
get_rpc_invoker
()
print
(
"goodgoodgood"
)
rpc_invoker
[
'qa/irrigation/create_answer_vote'
](
user_id
=
card_info
[
'current_user_id'
],
# rpc_invoker = get_rpc_invoker()
answer_id
=
card_info
[
'card_id'
])
.
unwrap
()
# rpc_invoker['qa/irrigation/create_answer_vote'](user_id=card_info['current_user_id'],
# answer_id=card_info['card_id']).unwrap()
return
True
return
True
except
:
except
:
logging_exception
()
logging_exception
()
...
...
comment/views/comment_fun.py
View file @
bbfeae53
...
@@ -40,10 +40,12 @@ def comment(card_info):
...
@@ -40,10 +40,12 @@ def comment(card_info):
return
True
return
True
# send_email_tome(str(redis_data) + str(card_info))
# send_email_tome(str(redis_data) + str(card_info))
else
:
else
:
rpc_invoker
=
get_rpc_invoker
()
print
(
"tractate"
)
rpc_invoker
[
'qa/irrigation/create_answer_reply'
](
user_id
=
card_info
[
'current_user_id'
],
answer_id
=
card_info
[
'card_id'
],
# rpc_invoker = get_rpc_invoker()
content
=
card_info
[
'comment_content'
])
.
unwrap
()
# 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()
elif
card_info
[
'card_status'
]
==
'diary'
:
elif
card_info
[
'card_status'
]
==
'diary'
:
today
=
datetime
.
datetime
.
now
()
today
=
datetime
.
datetime
.
now
()
...
@@ -69,10 +71,12 @@ def comment(card_info):
...
@@ -69,10 +71,12 @@ def comment(card_info):
return
True
return
True
# send_email_tome(str(redis_data) + str(card_info))
# send_email_tome(str(redis_data) + str(card_info))
else
:
else
:
rpc_invoker
=
get_rpc_invoker
()
print
(
"diary"
)
rpc_invoker
[
'qa/irrigation/create_answer_reply'
](
user_id
=
card_info
[
'current_user_id'
],
answer_id
=
card_info
[
'card_id'
],
# rpc_invoker = get_rpc_invoker()
content
=
card_info
[
'comment_content'
])
.
unwrap
()
# 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()
else
:
else
:
today
=
datetime
.
datetime
.
now
()
today
=
datetime
.
datetime
.
now
()
...
@@ -99,10 +103,12 @@ def comment(card_info):
...
@@ -99,10 +103,12 @@ def comment(card_info):
return
True
return
True
# send_email_tome(str(redis_data) + str(card_info))
# send_email_tome(str(redis_data) + str(card_info))
else
:
else
:
rpc_invoker
=
get_rpc_invoker
()
print
(
"answer"
)
rpc_invoker
[
'qa/irrigation/create_answer_reply'
](
user_id
=
card_info
[
'current_user_id'
],
answer_id
=
card_info
[
'card_id'
],
# rpc_invoker = get_rpc_invoker()
content
=
card_info
[
'comment_content'
])
.
unwrap
()
# 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
return
True
except
:
except
:
logging_exception
()
logging_exception
()
...
...
follow/views/follow_fun.py
View file @
bbfeae53
...
@@ -31,9 +31,11 @@ def follow(card_info):
...
@@ -31,9 +31,11 @@ def follow(card_info):
return
True
return
True
# send_email_tome(str(redis_data) + str(card_info))
# send_email_tome(str(redis_data) + str(card_info))
else
:
else
:
rpc_invoker
=
get_rpc_invoker
()
print
(
"goodgoodgood"
)
rpc_invoker
[
'api/irrigation/user_add_follow'
](
follow_user_id
=
card_info
[
'current_user_id'
],
followed_user_id
=
card_info
[
'card_user_id'
])
.
unwrap
()
# 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()
return
True
return
True
except
:
except
:
...
...
moment/views/consum.py
View file @
bbfeae53
...
@@ -42,12 +42,14 @@ def kafka_consum(topic_name=None):
...
@@ -42,12 +42,14 @@ def kafka_consum(topic_name=None):
if
card_info
[
'card_type'
]
==
"auto_vest"
:
if
card_info
[
'card_type'
]
==
"auto_vest"
:
###在这里去判断一下当前的partition和offset是否已经消费过了 如果已经消费了需要直接去掉数据
###在这里去判断一下当前的partition和offset是否已经消费过了 如果已经消费了需要直接去掉数据
bol_consum
=
judge_offset_partition_have_consum
(
offset
=
msg
.
offset
,
partition
=
msg
.
partition
)
bol_consum
=
judge_offset_partition_have_consum
(
offset
=
msg
.
offset
,
partition
=
msg
.
partition
)
if
bol_consum
:
if
bol_consum
:
logging
.
info
(
"消费到新数据了[
%
s,
%
s,
%
s,
%
s],get card_info:
%
s"
%
(
logging
.
info
(
"消费到新数据了[
%
s,
%
s,
%
s,
%
s],get card_info:
%
s"
%
(
str
(
msg
.
topic
),
str
(
msg
.
partition
),
str
(
msg
.
offset
),
str
(
msg
.
key
),
card_info
))
str
(
msg
.
topic
),
str
(
msg
.
partition
),
str
(
msg
.
offset
),
str
(
msg
.
key
),
card_info
))
redis_client
.
hset
(
redis_topic_partition_name
,
msg
.
partition
,
msg
.
offset
)
redis_client
.
hset
(
redis_topic_partition_name
,
msg
.
partition
,
msg
.
offset
)
# 代表当天数据
# 如果没有代表是之前的老的数据
if
'card_status'
not
in
card_info
:
card_info
[
'card_status'
]
=
'answer'
current_push_time
=
card_info
[
'current_push_time'
]
current_push_time
=
card_info
[
'current_push_time'
]
create_time
=
card_info
[
'create_time'
]
create_time
=
card_info
[
'create_time'
]
nowtime
=
datetime
.
datetime
.
now
()
nowtime
=
datetime
.
datetime
.
now
()
...
...
moment/views/process_time.py
View file @
bbfeae53
...
@@ -370,7 +370,7 @@ def get_current_card_content_level(card_info=[]):
...
@@ -370,7 +370,7 @@ def get_current_card_content_level(card_info=[]):
sql
=
'select content_level from api_diary where id =
%
s '
%
(
card_info
[
'card_id'
])
sql
=
'select content_level from api_diary where id =
%
s '
%
(
card_info
[
'card_id'
])
zhengxing_cursor
.
execute
(
sql
)
zhengxing_cursor
.
execute
(
sql
)
data
=
list
(
zhengxing_cursor
.
fetchall
())
data
=
list
(
zhengxing_cursor
.
fetchall
())
logging
.
info
(
"get_content_level_card_info:
%
s"
%
card_info
)
if
len
(
data
)
>
0
:
if
len
(
data
)
>
0
:
return
int
(
data
[
0
][
0
])
return
int
(
data
[
0
][
0
])
...
...
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