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
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
赵磊
saturn
Commits
5a95d04b
Commit
5a95d04b
authored
Jun 26, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
fix branch batch create api See merge request
alpha/saturn!65
parents
2b6c2695
80029a3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
product.py
api/views/product.py
+14
-4
No files found.
api/views/product.py
View file @
5a95d04b
...
...
@@ -91,10 +91,20 @@ class ProductBatchCreate(BaseView):
class
BrandBatchCreate
(
BaseView
):
'''批量创建品牌'''
def
post
(
self
,
request
):
brand_infos
=
request
.
POST
.
get
(
'data'
)
brand_infos
=
json
.
loads
(
request
.
POST
.
get
(
'data'
,
'[]'
)
)
if
not
brand_infos
:
return
self
.
error
(
self
.
get_ErrorInfo
(
ERROR
.
PARAMS_INCOMPLETE
))
error
,
ret
=
self
.
call_rpc
(
'neptune/commodity/brand/batch_create'
,
infos
=
brand_infos
,
platform
=
PRODUCT_FLATFORM
.
BEVOL
)
return
error
,
ret
infos
=
[{
'id'
:
item
.
get
(
'brandId'
),
'cn_name'
:
item
.
get
(
'displayName'
),
'en_name'
:
item
.
get
(
'aliasName'
),
'icon'
:
item
.
get
(
'imgPath'
),
'description'
:
item
.
get
(
'description'
)
}
for
item
in
brand_infos
]
error
,
_
=
self
.
call_rpc
(
'neptune/commodity/brand/batch_create'
,
infos
=
infos
,
platform
=
PRODUCT_FLATFORM
.
BEVOL
)
if
error
:
return
self
.
error
(
error
)
return
self
.
ok
()
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