Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
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
1
Merge Requests
1
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
saturn
Commits
8a423bed
Commit
8a423bed
authored
Feb 26, 2019
by
王浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batch create topic tag is_own
parent
ee1eaf07
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
urls.py
api/urls.py
+1
-0
tag.py
api/views/tag.py
+0
-1
topic.py
api/views/topic.py
+1
-1
user.py
api/views/user.py
+18
-0
No files found.
api/urls.py
View file @
8a423bed
...
@@ -19,4 +19,5 @@ urlpatterns = [
...
@@ -19,4 +19,5 @@ urlpatterns = [
# user
# user
url
(
r'^v1/user/shadow/list$'
,
user
.
ShadowUserList
.
as_view
(),
name
=
'create_tag_for_batch'
),
url
(
r'^v1/user/shadow/list$'
,
user
.
ShadowUserList
.
as_view
(),
name
=
'create_tag_for_batch'
),
url
(
r'^v1/validate_3party_account$'
,
user
.
Validate3PartyAccount
.
as_view
(),
name
=
'validate_3party_account$'
),
url
(
r'^v1/validate_3party_account$'
,
user
.
Validate3PartyAccount
.
as_view
(),
name
=
'validate_3party_account$'
),
url
(
r'^v1/user/batch_create_shadow_user$'
,
user
.
BatchCreateShadowUser
.
as_view
(),
name
=
'batch_create_shadow_user$'
),
]
]
api/views/tag.py
View file @
8a423bed
...
@@ -22,7 +22,6 @@ class CreateTagForBatch(BaseView):
...
@@ -22,7 +22,6 @@ class CreateTagForBatch(BaseView):
tags
.
append
(
tag
)
tags
.
append
(
tag
)
else
:
else
:
tags
=
tag_list
tags
=
tag_list
error
,
data
=
self
.
call_rpc
(
'venus/community/tag/batch_create_not_classify'
,
data
=
tags
)
error
,
data
=
self
.
call_rpc
(
'venus/community/tag/batch_create_not_classify'
,
data
=
tags
)
if
error
:
if
error
:
...
...
api/views/topic.py
View file @
8a423bed
...
@@ -65,7 +65,7 @@ class CreateTopicForBatch(BaseView):
...
@@ -65,7 +65,7 @@ class CreateTopicForBatch(BaseView):
# 先创建标签
# 先创建标签
_tag_error
,
_tag_data
=
self
.
call_rpc
(
_tag_error
,
_tag_data
=
self
.
call_rpc
(
"venus/community/tag/batch_create_tag_by_name"
,
"venus/community/tag/batch_create_tag_by_name"
,
tag_names
=
tags
tag_names
=
tags
,
is_own
=
1
)
)
if
_tag_error
:
if
_tag_error
:
return
self
.
error
(
_tag_error
)
return
self
.
error
(
_tag_error
)
...
...
api/views/user.py
View file @
8a423bed
...
@@ -59,3 +59,21 @@ class Validate3PartyAccount(BaseView):
...
@@ -59,3 +59,21 @@ class Validate3PartyAccount(BaseView):
return
self
.
error
(
err
)
return
self
.
error
(
err
)
data
=
{
account_id
:
_data
.
get
(
account_id
,
False
)
for
account_id
in
account_ids
}
data
=
{
account_id
:
_data
.
get
(
account_id
,
False
)
for
account_id
in
account_ids
}
return
self
.
ok
(
data
=
data
)
return
self
.
ok
(
data
=
data
)
class
BatchCreateShadowUser
(
BaseView
):
"""
批量创建马甲用户
"""
def
post
(
self
,
request
):
request_data
=
json
.
loads
(
request
.
POST
.
get
(
'ins_data'
,
'[]'
))
print
(
request_data
)
err
,
_data
=
self
.
call_rpc
(
"venus/community/user/batch_create_shadow_user"
,
data
=
request_data
)
if
err
:
return
self
.
error
(
err
)
return
self
.
ok
(
data
=
_data
)
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