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
ef90c6fd
Commit
ef90c6fd
authored
Mar 13, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
98e4ffae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
topic.py
search/views/topic.py
+3
-3
No files found.
search/views/topic.py
View file @
ef90c6fd
...
@@ -42,7 +42,7 @@ def get_discover_page_topic_ids(user_id,device_id,size,query_type=TopicPageType.
...
@@ -42,7 +42,7 @@ def get_discover_page_topic_ids(user_id,device_id,size,query_type=TopicPageType.
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
[]
return
[]
def
get_home_recommend_topic_ids
(
tag_id
,
user_id
,
device
_id
,
offset
,
size
,
query
=
None
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
):
def
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag
_id
,
offset
,
size
,
query
=
None
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
):
try
:
try
:
if
query
is
None
:
if
query
is
None
:
if
user_id
==
-
1
:
if
user_id
==
-
1
:
...
@@ -154,7 +154,7 @@ def home_recommend(device_id="",user_id=-1,offset=0,size=10,query_type=TopicPage
...
@@ -154,7 +154,7 @@ def home_recommend(device_id="",user_id=-1,offset=0,size=10,query_type=TopicPage
if
not
isinstance
(
device_id
,
str
):
if
not
isinstance
(
device_id
,
str
):
device_id
=
""
device_id
=
""
recommend_topic_ids
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
offset
=
0
,
size
=
size
,
query_type
=
query_type
)
recommend_topic_ids
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
=
0
,
offset
=
0
,
size
=
size
,
query_type
=
query_type
)
return
{
"recommend_topic_ids"
:
recommend_topic_ids
}
return
{
"recommend_topic_ids"
:
recommend_topic_ids
}
except
:
except
:
...
@@ -203,7 +203,7 @@ def home_query(tag_id="",device_id="",user_id=-1,query="",offset=0,size=10):
...
@@ -203,7 +203,7 @@ def home_query(tag_id="",device_id="",user_id=-1,query="",offset=0,size=10):
if
not
isinstance
(
device_id
,
str
):
if
not
isinstance
(
device_id
,
str
):
device_id
=
""
device_id
=
""
recommend_topic_ids
=
get_home_recommend_topic_ids
(
tag_id
,
user_id
,
device
_id
,
offset
,
size
,
query
)
recommend_topic_ids
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag
_id
,
offset
,
size
,
query
)
return
{
"recommend_topic_ids"
:
recommend_topic_ids
}
return
{
"recommend_topic_ids"
:
recommend_topic_ids
}
except
:
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
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