Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
0
Merge Requests
0
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
钟尚武
physical
Commits
69504c7f
Commit
69504c7f
authored
Aug 21, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
5d237e6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
11 deletions
+68
-11
topic_models.py
vest/data/topic_models.py
+13
-0
principal_online_comment1.py
vest/pictorial/principal_online_comment1.py
+14
-3
true_comment_one.py
vest/reply/true_comment_one.py
+41
-8
No files found.
vest/data/topic_models.py
View file @
69504c7f
...
...
@@ -3,6 +3,7 @@ import logging
from
trans2es.models.topic
import
TopicTag
,
TopicImage
,
CommunityTopicProduct
,
Topic
from
django.conf
import
settings
from
trans2es.models.pictorial
import
PictorialTag
from
random
import
randint
from
trans2es.models.user_extra
import
UserExtra
...
...
@@ -81,3 +82,15 @@ def get_pictorial_tag_by_id(self):
# except:
# logging.error("catch exception,err_msg:%s" % traceback.format_exc())
# return []
def
get_recomment_data
():
try
:
last
=
Topic
.
objects
.
count
()
-
1
index1
=
randint
(
0
,
last
)
MyObj1
=
Topic
.
objects
.
all
()[
index1
]
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
[]
vest/pictorial/principal_online_comment1.py
View file @
69504c7f
...
...
@@ -4,6 +4,7 @@ import traceback
import
logging
from
vest.request.auto_request
import
logins
,
pictorial_reply
,
get_majia
,
get_pictorial_comment
,
time_conv_minute
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
vest.data.topic_models
import
get_pictorial_tag_by_id
"""
榜单新增内容(仅限在线的)
...
...
@@ -60,7 +61,7 @@ def principal_online_comment1():
logging
.
info
(
"comment offline pictorial"
)
numtime1
,
numtime2
,
minute
=
time_conv_minute
(
30
,
0
)
user_id
,
data_vote
=
get_data
(
numtime1
,
numtime2
)
dicts
=
{}
random_num
=
0
if
user_id
:
for
i
in
user_id
:
...
...
@@ -73,7 +74,13 @@ def principal_online_comment1():
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia
()
cook
=
logins
(
majia_user_id
)
comment
=
get_pictorial_comment
()
comment
=
""
# 判断是不是编辑标签
edit_judge
=
get_pictorial_tag_by_id
(
i
[
0
])
if
edit_judge
:
comment
=
get_pictorial_comment
()
else
:
comment
=
get_pictorial_comment
()
if
cook
is
not
None
:
pictorial_reply
(
cook
,
i
[
0
],
comment
)
if
data_vote
:
...
...
@@ -82,7 +89,11 @@ def principal_online_comment1():
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia
()
cook
=
logins
(
majia_user_id
)
comment
=
get_pictorial_comment
()
edit_judge
=
get_pictorial_tag_by_id
(
i
[
0
])
if
edit_judge
:
comment
=
get_pictorial_comment
()
else
:
comment
=
get_pictorial_comment
()
if
cook
is
not
None
:
pictorial_reply
(
cook
,
i
[
0
],
comment
)
...
...
vest/reply/true_comment_one.py
View file @
69504c7f
...
...
@@ -4,7 +4,8 @@ import logging
from
vest.request.auto_request
import
login
,
time_conv
,
get_comment
,
reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
def
get_data
(
numtime
,
numtime2
):
...
...
@@ -40,6 +41,24 @@ def get_data(numtime, numtime2):
return
[]
# def true_comment_one():
# try:
# logging.info("comment one")
# numtime1, numtime2 = time_conv(5, 0)
# user_id = get_data(numtime1, numtime2)
# if user_id:
# for i in user_id:
# cook = login()
# comment = get_comment()
# if cook is not None:
# reply(cook, i[1], comment)
# else:
# logging.error("catch exception,main:%s" % traceback.format_exc())
# except:
# logging_exception()
# logging.error("catch exception,main:%s" % traceback.format_exc())
def
true_comment_one
():
try
:
logging
.
info
(
"comment one"
)
...
...
@@ -47,15 +66,29 @@ def true_comment_one():
user_id
=
get_data
(
numtime1
,
numtime2
)
if
user_id
:
for
i
in
user_id
:
cook
=
login
()
comment
=
get_comment
()
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
comment
=
""
#先判断是不是编辑标签
edit_judge
=
get_edit_tag_id_list
(
i
[
1
])
if
edit_judge
:
comment
=
get_comment
()
else
:
# 判断有没有商品信息
product_judge
=
get_topic_product_info
(
i
[
1
])
if
product_judge
:
comment
=
get_comment
()
else
:
#判断有没有人脸
face_judge
=
topic_has_image
(
i
[
1
])
if
face_judge
:
comment
=
get_comment
()
else
:
comment
=
get_comment
()
cookie
=
login
()
if
cookie
is
not
None
:
reply
(
cookie
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
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