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