分类API接口代码完善

This commit is contained in:
Chopper 2021-09-22 09:17:59 +08:00
parent a3d73bf7ad
commit f3f3d3f936
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -37,6 +38,7 @@ public class Category extends BaseEntity {
private String parentId; private String parentId;
@NotNull(message = "层级不能为空") @NotNull(message = "层级不能为空")
@Min(value = 0,message = "层级需要大于0")
@ApiModelProperty(value = "层级, 从0开始") @ApiModelProperty(value = "层级, 从0开始")
private Integer level; private Integer level;

View File

@ -89,7 +89,7 @@ public class CategoryManagerController {
} }
@DeleteMapping(value = "/{id}") @DeleteMapping(value = "/{id}")
@ApiImplicitParam(name = "goodsId", value = "分类ID", required = true, paramType = "path", dataType = "String") @ApiImplicitParam(name = "id", value = "分类ID", required = true, paramType = "path", dataType = "String")
@ApiOperation(value = "通过id删除分类") @ApiOperation(value = "通过id删除分类")
public ResultMessage<Category> delAllByIds(@NotNull @PathVariable String id) { public ResultMessage<Category> delAllByIds(@NotNull @PathVariable String id) {
Category category = new Category(); Category category = new Category();