分类信息保存增加校验

This commit is contained in:
Chopper
2021-06-18 17:33:45 +08:00
parent e5b9280b7e
commit 738a95edb6
2 changed files with 7 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ public class CategoryManagerController {
@PutMapping
@ApiOperation(value = "修改商品分类")
public ResultMessage<Category> updateCategory(CategoryVO category) {
public ResultMessage<Category> updateCategory(@Valid CategoryVO category) {
Category catTemp = categoryService.getById(category.getId());
if (catTemp == null) {
throw new ServiceException(ResultCode.CATEGORY_PARENT_NOT_EXIST);