Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
钟尚武
sun
Commits
a32ae366
Commit
a32ae366
authored
Apr 23, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
add ai fashion insert api See merge request
alpha/sun!179
parents
31d55bb0
6f52ffab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
tools.py
api/tools.py
+16
-0
urls.py
api/urls.py
+1
-0
No files found.
api/tools.py
View file @
a32ae366
import
time
import
time
import
json
from
utils.base
import
APIView
from
utils.base
import
APIView
from
gm_upload
import
upload
,
upload_file
from
gm_upload
import
upload
,
upload_file
from
openpyxl
import
load_workbook
from
openpyxl
import
load_workbook
...
@@ -71,3 +72,18 @@ class BatchUpdateTopicTag(APIView):
...
@@ -71,3 +72,18 @@ class BatchUpdateTopicTag(APIView):
self
.
rpc
[
'venus/sun/tools/batch_update_topic_tags'
](
topic_infos
=
topic_infos
)
.
unwrap
()
self
.
rpc
[
'venus/sun/tools/batch_update_topic_tags'
](
topic_infos
=
topic_infos
)
.
unwrap
()
return
{
'message'
:
u'上传成功'
,
'code'
:
200
}
return
{
'message'
:
u'上传成功'
,
'code'
:
200
}
class
BatchCreateTopicWithAiFashionTag
(
APIView
):
def
post
(
self
,
request
):
json_file
=
request
.
FILES
.
get
(
'file'
)
if
not
json_file
:
return
{
'message'
:
u'上传失败,请重新上传'
,
'code'
:
500
}
json_data
=
json
.
load
(
json_file
)
self
.
rpc
[
'venus/sun/tools/batch_create_topic_with_ai_fashion_tag'
](
infos
=
json_data
)
.
unwrap
()
return
{
'message'
:
u'上传成功'
,
'code'
:
200
}
api/urls.py
View file @
a32ae366
...
@@ -144,6 +144,7 @@ urlpatterns = [
...
@@ -144,6 +144,7 @@ urlpatterns = [
# 工具
# 工具
url
(
r'^tools/virtual_vote$'
,
VirtualVote
.
as_view
()),
url
(
r'^tools/virtual_vote$'
,
VirtualVote
.
as_view
()),
url
(
r'^tools/batch_update_topic_tag$'
,
BatchUpdateTopicTag
.
as_view
()),
url
(
r'^tools/batch_update_topic_tag$'
,
BatchUpdateTopicTag
.
as_view
()),
url
(
r'^tools/batch_create_topic_with_ai_fashion_tag$'
,
BatchCreateTopicWithAiFashionTag
.
as_view
()),
]
]
...
...
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