Commit 3870f2fcbf81c61d73e461c2893f8ee735626769
Committed by
GitHub
Merge pull request #1235 from dadiyang/fix/product-sku-price-min
[ENHANCE] 商城:商品 SKU 五个金额字段补接口层下限校验(>=0)
Showing
1 changed file
with
6 additions
and
0 deletions
yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSkuSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.spu.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.Min; | |
| 4 | 5 | import jakarta.validation.constraints.NotEmpty; |
| 5 | 6 | import jakarta.validation.constraints.NotNull; |
| 6 | 7 | import lombok.*; |
| ... | ... | @@ -17,12 +18,15 @@ public class ProductSkuSaveReqVO { |
| 17 | 18 | |
| 18 | 19 | @Schema(description = "销售价格,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1999") |
| 19 | 20 | @NotNull(message = "销售价格,单位:分不能为空") |
| 21 | + @Min(value = 0, message = "销售价格,单位:分不能小于 0") | |
| 20 | 22 | private Integer price; |
| 21 | 23 | |
| 22 | 24 | @Schema(description = "市场价", example = "2999") |
| 25 | + @Min(value = 0, message = "市场价不能小于 0") | |
| 23 | 26 | private Integer marketPrice; |
| 24 | 27 | |
| 25 | 28 | @Schema(description = "成本价", example = "19") |
| 29 | + @Min(value = 0, message = "成本价不能小于 0") | |
| 26 | 30 | private Integer costPrice; |
| 27 | 31 | |
| 28 | 32 | @Schema(description = "条形码", example = "15156165456") |
| ... | ... | @@ -43,9 +47,11 @@ public class ProductSkuSaveReqVO { |
| 43 | 47 | private Double volume; |
| 44 | 48 | |
| 45 | 49 | @Schema(description = "一级分销的佣金,单位:分", example = "199") |
| 50 | + @Min(value = 0, message = "一级分销的佣金,单位:分不能小于 0") | |
| 46 | 51 | private Integer firstBrokeragePrice; |
| 47 | 52 | |
| 48 | 53 | @Schema(description = "二级分销的佣金,单位:分", example = "19") |
| 54 | + @Min(value = 0, message = "二级分销的佣金,单位:分不能小于 0") | |
| 49 | 55 | private Integer secondBrokeragePrice; |
| 50 | 56 | |
| 51 | 57 | @Schema(description = "属性数组") | ... | ... |