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
alpha
physical
Commits
a60df02c
Commit
a60df02c
authored
Oct 13, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'wsy2'
# Conflicts: # README.md
parents
344b91f2
8c74626e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
0 deletions
+58
-0
README.md
README.md
+2
-0
topic.py
search/utils/topic.py
+12
-0
tag.py
search/views/tag.py
+22
-0
topic.py
search/views/topic.py
+0
-0
__init__.py
trans2es/models/__init__.py
+2
-0
account_reg_extra.py
trans2es/models/account_reg_extra.py
+20
-0
No files found.
README.md
View file @
a60df02c
...
...
@@ -55,8 +55,10 @@ celery -A physical beat
### physical策略端脚本
在Alp-Test-Cos-test001服务器上,通过crontab -l查看
<<<<<<< README.md
更新脚本
```
bash
make crontab
```
search/utils/topic.py
View file @
a60df02c
...
...
@@ -1339,7 +1339,19 @@ class TopicUtils(object):
}
}
})
elif
k
==
"is_kol"
:
f
.
append
({
"term"
:
{
"user_is_kol"
:
True
}
})
elif
k
==
"is_edit"
:
f
.
append
({
"term"
:
{
"user_is_edit"
:
True
}
})
# elif k == "pictorial_id":
# f.append({
# "nested": {
...
...
search/views/tag.py
View file @
a60df02c
...
...
@@ -16,6 +16,7 @@ from trans2es.models.tag import CommunityTagSetRelation
from
django.conf
import
settings
from
libs.error
import
logging_exception
from
django.db
import
connection
from
trans2es.models.account_reg_extra
import
AccountRegExtra
def
get_highlight
(
fields
=
[]):
...
...
@@ -143,6 +144,27 @@ def choice_pictorial_push_tag(device_id, user_id):
return
{
"pictorial_tag_list"
:
[]}
@bind
(
"physical/search/lintag_by_user_id"
)
def
get_lintags_by_user_id
(
user_id
):
try
:
devices
=
AccountRegExtra
.
objects
.
filter
(
user_id
=
user_id
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
"device_id"
,
flat
=
True
)
if
devices
:
linucb_recommend_redis_prefix
=
"physical:linucb:tag_recommend:device_id:"
device_id
=
devices
[
0
]
redis_key
=
linucb_recommend_redis_prefix
+
str
(
device_id
)
tag_data
=
redis_client
.
get
(
redis_key
)
lintags
=
[]
if
tag_data
is
None
:
lintags
=
[]
else
:
lintags
=
json
.
loads
(
str
(
tag_data
,
encoding
=
"utf-8"
))
return
{
"lin_tag_list"
:
lintags
[:
3
]}
return
{
"lin_tag_list"
:
[]}
except
Exception
as
e
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"lin_tag_list"
:
[]}
@bind
(
"physical/search/choice_push_tag"
)
def
choice_push_tag
(
device_id
,
user_id
):
"""
...
...
search/views/topic.py
View file @
a60df02c
This diff is collapsed.
Click to expand it.
trans2es/models/__init__.py
View file @
a60df02c
...
...
@@ -14,3 +14,5 @@ from .user import User
from
.group
import
Group
from
.pictorial
import
PictorialFollow
from
.pictorial
import
Pictorial
from
.account_reg_extra
import
AccountRegExtra
trans2es/models/account_reg_extra.py
0 → 100644
View file @
a60df02c
import
datetime
from
django.db
import
models
class
AccountRegExtra
(
models
.
Model
):
class
Meta
:
verbose_name
=
u"设备用户关系表"
db_table
=
"account_reg_extra"
id
=
models
.
IntegerField
(
verbose_name
=
"主键ID"
,
primary_key
=
True
)
is_online
=
models
.
BooleanField
(
verbose_name
=
u"是否上线"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u"创建时间"
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
update_time
=
models
.
DateTimeField
(
verbose_name
=
u"更新时间"
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
is_deleted
=
models
.
BooleanField
(
verbose_name
=
u""
)
geo
=
models
.
CharField
(
verbose_name
=
u""
,
max_length
=
300
)
model
=
models
.
CharField
(
verbose_name
=
u""
,
max_length
=
64
)
device_id
=
models
.
CharField
(
verbose_name
=
u"设备ID"
,
max_length
=
64
)
share_code
=
models
.
CharField
(
verbose_name
=
u""
,
max_length
=
64
)
user_id
=
models
.
IntegerField
(
verbose_name
=
"用户ID"
)
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