Commit eb767f77e37e8811da76f5edf24c7a1798fb70dd

Authored by YunaiV
1 parent 25c2fbd4

fix(mall): 校验售后申请类型必填

- 后端售后申请接口启用请求体参数校验
- 前端申请售后提交前校验售后类型
- 修正售后类型 radio 选中态绑定字段
yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppAfterSaleController.java
@@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation; @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation;
13 import io.swagger.v3.oas.annotations.Parameter; 13 import io.swagger.v3.oas.annotations.Parameter;
14 import io.swagger.v3.oas.annotations.tags.Tag; 14 import io.swagger.v3.oas.annotations.tags.Tag;
15 import jakarta.annotation.Resource; 15 import jakarta.annotation.Resource;
  16 +import jakarta.validation.Valid;
16 import lombok.extern.slf4j.Slf4j; 17 import lombok.extern.slf4j.Slf4j;
17 import org.springframework.validation.annotation.Validated; 18 import org.springframework.validation.annotation.Validated;
18 import org.springframework.web.bind.annotation.*; 19 import org.springframework.web.bind.annotation.*;
@@ -47,13 +48,13 @@ public class AppAfterSaleController { @@ -47,13 +48,13 @@ public class AppAfterSaleController {
47 48
48 @PostMapping(value = "/create") 49 @PostMapping(value = "/create")
49 @Operation(summary = "申请售后") 50 @Operation(summary = "申请售后")
50 - public CommonResult<Long> createAfterSale(@RequestBody AppAfterSaleCreateReqVO createReqVO) { 51 + public CommonResult<Long> createAfterSale(@Valid @RequestBody AppAfterSaleCreateReqVO createReqVO) {
51 return success(afterSaleService.createAfterSale(getLoginUserId(), createReqVO)); 52 return success(afterSaleService.createAfterSale(getLoginUserId(), createReqVO));
52 } 53 }
53 54
54 @PutMapping(value = "/delivery") 55 @PutMapping(value = "/delivery")
55 @Operation(summary = "退回货物") 56 @Operation(summary = "退回货物")
56 - public CommonResult<Boolean> deliveryAfterSale(@RequestBody AppAfterSaleDeliveryReqVO deliveryReqVO) { 57 + public CommonResult<Boolean> deliveryAfterSale(@Valid @RequestBody AppAfterSaleDeliveryReqVO deliveryReqVO) {
57 afterSaleService.deliveryAfterSale(getLoginUserId(), deliveryReqVO); 58 afterSaleService.deliveryAfterSale(getLoginUserId(), deliveryReqVO);
58 return success(true); 59 return success(true);
59 } 60 }