提交订单增加校验
This commit is contained in:
5
pom.xml
5
pom.xml
@ -80,6 +80,11 @@
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok (Optional) -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
||||
@ -9,6 +9,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: 张黎
|
||||
* @Date: 2025/07/25/16:42
|
||||
@ -38,7 +40,7 @@ public class ClientOrderController {
|
||||
|
||||
@ApiOperation(value = "生成租车订单")
|
||||
@PostMapping("/confirmRentalCarOrder")
|
||||
public Result<RentCarOrderResultDTO> confirmRentalCarOrder(@RequestBody RentCarOrderReq rentCarOrderReq){
|
||||
public Result<RentCarOrderResultDTO> confirmRentalCarOrder(@Valid @RequestBody RentCarOrderReq rentCarOrderReq){
|
||||
return Result.ok(orderService.submitRentCarOrder(rentCarOrderReq));
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: 张黎
|
||||
* @Date: 2025/07/25/16:58
|
||||
@ -14,31 +17,38 @@ import lombok.Data;
|
||||
@ApiModel(value = "租车订单请求参数")
|
||||
public class RentCarOrderReq {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "运营商id")
|
||||
private Long operatorId;
|
||||
|
||||
@ApiModelProperty(value = "门店id")
|
||||
@NotNull(message = "门店id不能为空")
|
||||
private Long storeId;
|
||||
|
||||
@ApiModelProperty(value = "客户id")
|
||||
private Long customerId;
|
||||
|
||||
@ApiModelProperty("车型ID")
|
||||
@NotNull(message = "车型ID不能为空")
|
||||
private Long carModelId;
|
||||
|
||||
@ApiModelProperty(value = "租车套餐id")
|
||||
@NotNull(message = "租车套餐id不能为空")
|
||||
private Long rentCarRuleId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "租电套餐id")
|
||||
@NotNull(message = "租电套餐id不能为空")
|
||||
private Long rentBatteyRuleId;
|
||||
|
||||
@ApiModelProperty("选择的电池类型")
|
||||
@NotBlank(message = "租电套餐id不能为空")
|
||||
private String batteryType;
|
||||
|
||||
|
||||
@ApiModelProperty("是否开通免押")
|
||||
private Boolean isDepositFree;
|
||||
private Boolean isDepositFree = false;
|
||||
|
||||
@ApiModelProperty("是否开通代扣")
|
||||
private Boolean isAutoDeduct;
|
||||
private Boolean isAutoDeduct = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user