Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
82abe115
Commit
82abe115
authored
Nov 14, 2018
by
Junling Bu
Browse files
feat[litemall-admin-api]: 品牌商和分类允许空
parent
6eef7abc
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminGoodsController.java
View file @
82abe115
...
...
@@ -80,19 +80,19 @@ public class AdminGoodsController {
if
(
StringUtils
.
isEmpty
(
goodsSn
)){
return
ResponseUtil
.
badArgument
();
}
// 品牌商可以不设置,如果设置则需要验证品牌商存在
Integer
brandId
=
goods
.
getBrandId
();
if
(
brandId
==
null
){
return
ResponseUtil
.
badArgument
();
}
if
(
brandService
.
findById
(
brandId
)
==
null
)
{
return
ResponseUtil
.
badArgumentValue
();
if
(
brandId
!=
null
&&
brandId
!=
0
)
{
if
(
brandService
.
findById
(
brandId
)
==
null
)
{
return
ResponseUtil
.
badArgumentValue
();
}
}
// 分类可以不设置,如果设置则需要验证分类存在
Integer
categoryId
=
goods
.
getCategoryId
();
if
(
categoryId
==
null
){
return
ResponseUtil
.
badArgument
();
}
if
(
categoryService
.
findById
(
categoryId
)
==
null
){
return
ResponseUtil
.
badArgumentValue
();
if
(
categoryId
!=
null
&&
categoryId
!=
0
)
{
if
(
categoryService
.
findById
(
categoryId
)
==
null
)
{
return
ResponseUtil
.
badArgumentValue
();
}
}
LitemallGoodsAttribute
[]
attributes
=
goodsAllinone
.
getAttributes
();
...
...
Write
Preview
Supports
Markdown
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