Commit c6f1b658259ce1369cc3b696c0cdba60b8794820
1 parent
3a6150f5
fix(product):SPU 配送方式补字典值域校验——SpuSaveReqVO.deliveryTypes 加 `@InEnum(DeliveryType…
…Enum)`,枚举外值(如 3=虚拟)保存即拒 400,不再静默入库到下单才暴露;product 补 trade-api 依赖取在位枚举(A68)
Showing
2 changed files
with
10 additions
and
0 deletions
yudao-module-mall/yudao-module-product/pom.xml
| ... | ... | @@ -24,6 +24,13 @@ |
| 24 | 24 | <version>${revision}</version> |
| 25 | 25 | </dependency> |
| 26 | 26 | |
| 27 | + <!-- trade-api:配送方式枚举 DeliveryTypeEnum 校验(A68) --> | |
| 28 | + <dependency> | |
| 29 | + <groupId>cn.iocoder.boot</groupId> | |
| 30 | + <artifactId>yudao-module-trade-api</artifactId> | |
| 31 | + <version>${revision}</version> | |
| 32 | + </dependency> | |
| 33 | + | |
| 27 | 34 | <!-- 业务组件 --> |
| 28 | 35 | |
| 29 | 36 | <!-- Web 相关 --> | ... | ... |
yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuSaveReqVO.java
| ... | ... | @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import jakarta.validation.Valid; |
| 5 | +import cn.iocoder.yudao.framework.common.validation.InEnum; | |
| 6 | +import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum; | |
| 5 | 7 | import jakarta.validation.constraints.NotEmpty; |
| 6 | 8 | import jakarta.validation.constraints.NotNull; |
| 7 | 9 | import lombok.Data; |
| ... | ... | @@ -61,6 +63,7 @@ public class ProductSpuSaveReqVO { |
| 61 | 63 | |
| 62 | 64 | @Schema(description = "配送方式数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 63 | 65 | @NotEmpty(message = "配送方式不能为空") |
| 66 | + @InEnum(value = DeliveryTypeEnum.class, message = "配送方式不正确") | |
| 64 | 67 | private List<Integer> deliveryTypes; |
| 65 | 68 | |
| 66 | 69 | @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") | ... | ... |