Commit 23d6ea4b authored by duanruiming's avatar duanruiming

[update] UTC服务添加参数校验逻辑

parent 9aac9c66
...@@ -138,27 +138,28 @@ public class ControlCommandController { ...@@ -138,27 +138,28 @@ public class ControlCommandController {
@AspectLog(description = "步进控制-步进控制/恢复", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "步进控制-步进控制/恢复", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "步进控制-步进控制/恢复", notes = "步进控制-步进控制/恢复") @ApiOperation(value = "步进控制-步进控制/恢复", notes = "步进控制-步进控制/恢复")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "crossCode", value = "13位路口编号", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "command", value = "1 开始步进 0 取消步进", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = "command", value = "1 开始步进 0 取消步进", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "stepNum", value = "0 顺序步进 n 跳过n个相位", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = "stepNum", value = "0 顺序步进 n 跳过n个相位", paramType = "query", required = true, dataType = "int"),
}) })
@PostMapping("/stepControl") @PostMapping("/stepControl")
public JsonViewObject stepControl(@RequestParam String code, public JsonViewObject stepControl(@RequestParam String crossCode,
@RequestParam Integer command, @RequestParam Integer command,
@RequestParam int stepNum) throws Exception { @RequestParam int stepNum) throws Exception {
return controlCommandStrategyService.stepControlStrategy(code, command, stepNum); return controlCommandStrategyService.stepControlStrategy(crossCode, command, stepNum);
} }
/** /**
* 恢复时间表 * 恢复时间表
* *
* @param code 信号id * @param crossCode
* @return * @return
*/ */
@AspectLog(description = "恢复时间表-恢复路口时间表执行", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "恢复时间表-恢复路口时间表执行", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "恢复时间表-恢复路口时间表执行", notes = "恢复时间表-恢复路口时间表执行") @ApiOperation(value = "恢复时间表-恢复路口时间表执行", notes = "恢复时间表-恢复路口时间表执行")
@PostMapping("/recoverSchedule") @PostMapping("/recoverSchedule")
public JsonViewObject recoverSchedule(@RequestParam String code) throws Exception { public JsonViewObject recoverSchedule(@RequestParam String crossCode) throws Exception {
return controlCommandStrategyService.recoverScheduleStrategy(code); return controlCommandStrategyService.recoverScheduleStrategy(crossCode);
} }
/** /**
......
...@@ -15,6 +15,7 @@ import net.wanji.utc.po.ManufacturerApiInfoPO; ...@@ -15,6 +15,7 @@ import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService; import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO; import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -55,7 +56,7 @@ public class ManufacturerApiController { ...@@ -55,7 +56,7 @@ public class ManufacturerApiController {
@AspectLog(description = "接口添加或修改", operationType = BaseEnum.OperationTypeEnum.QUERY) @AspectLog(description = "接口添加或修改", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody ManufacturerApiInfoInsertOrUpdateDTO inVO) { public JsonViewObject insertOrUpdate(@RequestBody @Validated ManufacturerApiInfoInsertOrUpdateDTO inVO) {
manufacturerApiInfoService.insertOrUpdate(inVO); manufacturerApiInfoService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
...@@ -14,6 +14,7 @@ import net.wanji.utc.dto.systemadmin.ManufacturerListDTO; ...@@ -14,6 +14,7 @@ import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -62,7 +63,7 @@ public class ManufacturerController { ...@@ -62,7 +63,7 @@ public class ManufacturerController {
@AspectLog(description = "厂商添加或修改", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "厂商添加或修改", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody ManufacturerInsertOrUpdateDTO inVO) { public JsonViewObject insertOrUpdate(@RequestBody @Validated ManufacturerInsertOrUpdateDTO inVO) {
manufacturerService.insertOrUpdate(inVO); manufacturerService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
...@@ -17,6 +17,7 @@ import net.wanji.utc.service.staticinfo.StaticInfoService; ...@@ -17,6 +17,7 @@ import net.wanji.utc.service.staticinfo.StaticInfoService;
import net.wanji.utc.vo.PlanSectionVO; import net.wanji.utc.vo.PlanSectionVO;
import net.wanji.utc.vo.SchemePhaseLightsVO; import net.wanji.utc.vo.SchemePhaseLightsVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -46,7 +47,7 @@ public class StaticInfoController { ...@@ -46,7 +47,7 @@ public class StaticInfoController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossInfoPO.class) @ApiResponse(code = 200, message = "OK", response = CrossInfoPO.class)
}) })
public JsonViewObject crossInfo(@RequestBody CrossInfoDTO crossInfoDTO) throws Exception { public JsonViewObject crossInfo(@RequestBody @Validated CrossInfoDTO crossInfoDTO) throws Exception {
List<CrossInfoPO> crossInfoPOList = staticInfoService.crossBasicInfo(crossInfoDTO); List<CrossInfoPO> crossInfoPOList = staticInfoService.crossBasicInfo(crossInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
...@@ -62,7 +63,7 @@ public class StaticInfoController { ...@@ -62,7 +63,7 @@ public class StaticInfoController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SchemePhaseLightsVO.class) @ApiResponse(code = 200, message = "OK", response = SchemePhaseLightsVO.class)
}) })
public JsonViewObject schemePhaseLights(@RequestBody SchemePhaseLightsDTO schemePhaseLightsDTO) throws Exception { public JsonViewObject schemePhaseLights(@RequestBody @Validated SchemePhaseLightsDTO schemePhaseLightsDTO) throws Exception {
// 更新数据库 // 更新数据库
staticInfoService.schemePhaseLights(schemePhaseLightsDTO); staticInfoService.schemePhaseLights(schemePhaseLightsDTO);
// 构造返回值 // 构造返回值
...@@ -80,7 +81,7 @@ public class StaticInfoController { ...@@ -80,7 +81,7 @@ public class StaticInfoController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = PlanSectionVO.class) @ApiResponse(code = 200, message = "OK", response = PlanSectionVO.class)
}) })
public JsonViewObject planSection(@RequestBody PlanSectionDTO planSectionDTO) throws Exception { public JsonViewObject planSection(@RequestBody @Validated PlanSectionDTO planSectionDTO) throws Exception {
// 更新数据库 // 更新数据库
staticInfoService.planSection(planSectionDTO); staticInfoService.planSection(planSectionDTO);
// 构造返回值 // 构造返回值
...@@ -107,7 +108,7 @@ public class StaticInfoController { ...@@ -107,7 +108,7 @@ public class StaticInfoController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossSchedulesPO.class) @ApiResponse(code = 200, message = "OK", response = CrossSchedulesPO.class)
}) })
public JsonViewObject crossSchedules(@RequestBody CrossSchedulesDTO crossSchedulesDTO) throws Exception { public JsonViewObject crossSchedules(@RequestBody @Validated CrossSchedulesDTO crossSchedulesDTO) throws Exception {
// 更新数据库 // 更新数据库
staticInfoService.crossSchedules(crossSchedulesDTO); staticInfoService.crossSchedules(crossSchedulesDTO);
// 构造返回值 // 构造返回值
......
...@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,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.Pattern;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/15 9:57 * @date 2022/11/15 9:57
...@@ -12,5 +15,7 @@ import lombok.Data; ...@@ -12,5 +15,7 @@ import lombok.Data;
@ApiModel(value = "CrossInfoDTO", description = "查询信号路口基础信息输入参数") @ApiModel(value = "CrossInfoDTO", description = "查询信号路口基础信息输入参数")
public class CrossInfoDTO { public class CrossInfoDTO {
@ApiModelProperty(value = "厂商代码 HK") @ApiModelProperty(value = "厂商代码 HK")
@NotBlank
@Pattern(regexp = "^[A-Z]*$", message = "厂商代码只能包含大写英文字母")
String manufacturerCode; String manufacturerCode;
} }
...@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,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.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
/** /**
...@@ -14,8 +17,11 @@ import java.util.List; ...@@ -14,8 +17,11 @@ import java.util.List;
@ApiModel(value = "CrossSchedulesDTO", description = "查询时间表数据输入参数") @ApiModel(value = "CrossSchedulesDTO", description = "查询时间表数据输入参数")
public class CrossSchedulesDTO { public class CrossSchedulesDTO {
@ApiModelProperty(value = "厂商代码 HK") @ApiModelProperty(value = "厂商代码 HK")
@NotBlank
@Pattern(regexp = "^[A-Z]*$", message = "厂商代码只能包含大写英文字母")
String manufacturerCode; String manufacturerCode;
@ApiModelProperty(value = "路口列表") @ApiModelProperty(value = "路口列表")
@NotEmpty
List<String> crossIdList; List<String> crossIdList;
} }
...@@ -4,6 +4,10 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,10 @@ 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.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/15 9:57 * @date 2022/11/15 9:57
...@@ -12,8 +16,11 @@ import lombok.Data; ...@@ -12,8 +16,11 @@ import lombok.Data;
@ApiModel(value = "PlanSectionDTO", description = "查询计划数据-计划信息、时段信息输入参数") @ApiModel(value = "PlanSectionDTO", description = "查询计划数据-计划信息、时段信息输入参数")
public class PlanSectionDTO { public class PlanSectionDTO {
@ApiModelProperty(value = "路口ID") @ApiModelProperty(value = "路口ID")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossId; private String crossId;
@ApiModelProperty(value = "计划号,-1代表所有") @ApiModelProperty(value = "计划号,-1代表所有")
@NotNull(message = "最小为-1,查所有")
@Min(value = -1, message = "最小为-1,查所有")
private Integer planNo; private Integer planNo;
} }
...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,8 @@ 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.Pattern;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/16 13:23 * @date 2022/11/16 13:23
...@@ -12,5 +14,6 @@ import lombok.Data; ...@@ -12,5 +14,6 @@ import lombok.Data;
@ApiModel(value = "SchemePhaseLightsDTO", description = "查询方案数据-方案信息、相位信息、灯组信息输入参数") @ApiModel(value = "SchemePhaseLightsDTO", description = "查询方案数据-方案信息、相位信息、灯组信息输入参数")
public class SchemePhaseLightsDTO { public class SchemePhaseLightsDTO {
@ApiModelProperty(value = "路口ID") @ApiModelProperty(value = "路口ID")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossId; private String crossId;
} }
...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,8 @@ 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;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/24 15:20 * @date 2022/11/24 15:20
...@@ -16,20 +18,26 @@ public class ManufacturerApiInfoInsertOrUpdateDTO { ...@@ -16,20 +18,26 @@ public class ManufacturerApiInfoInsertOrUpdateDTO {
private Integer id ; private Integer id ;
/** 接口代码 */ /** 接口代码 */
@ApiModelProperty(required = true, value = "接口代码",notes = "") @ApiModelProperty(required = true, value = "接口代码",notes = "")
@NotBlank
private String code ; private String code ;
/** 接口名称 */ /** 接口名称 */
@ApiModelProperty(required = true, value = "接口名称",notes = "") @ApiModelProperty(required = true, value = "接口名称",notes = "")
@NotBlank
private String name ; private String name ;
/** 接口类型 */ /** 接口类型 */
@ApiModelProperty(required = true, value = "接口类型",notes = "") @ApiModelProperty(required = true, value = "接口类型",notes = "")
@NotBlank
private String apiType ; private String apiType ;
/** 请求方式:GET、POST */ /** 请求方式:GET、POST */
@ApiModelProperty(required = true, value = "请求方式:GET、POST",notes = "") @ApiModelProperty(required = true, value = "请求方式:GET、POST",notes = "")
@NotBlank
private String method ; private String method ;
/** 接口地址 */ /** 接口地址 */
@ApiModelProperty(required = true, value = "接口地址",notes = "") @ApiModelProperty(required = true, value = "接口地址",notes = "")
@NotBlank
private String address ; private String address ;
/** 接口厂商 */ /** 接口厂商 */
@ApiModelProperty(required = true, value = "接口厂商",notes = "") @ApiModelProperty(required = true, value = "接口厂商",notes = "")
@NotBlank
private String manufacturerNick; private String manufacturerNick;
} }
...@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,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.Pattern;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/24 9:42 * @date 2022/11/24 9:42
...@@ -17,17 +20,23 @@ public class ManufacturerInsertOrUpdateDTO { ...@@ -17,17 +20,23 @@ public class ManufacturerInsertOrUpdateDTO {
private Integer id ; private Integer id ;
/** 厂商代码 */ /** 厂商代码 */
@ApiModelProperty(required = true, value = "厂商代码",notes = "") @ApiModelProperty(required = true, value = "厂商代码",notes = "")
@NotBlank
@Pattern(regexp = "^[A-Z]*$", message = "厂商代码只能包含大写英文字母")
private String code ; private String code ;
/** 厂商名称 */ /** 厂商名称 */
@ApiModelProperty(required = true, value = "厂商名称",notes = "") @ApiModelProperty(required = true, value = "厂商名称",notes = "")
@NotBlank
private String name ; private String name ;
/** 厂商简称 */ /** 厂商简称 */
@ApiModelProperty(required = true, value = "厂商简称",notes = "") @ApiModelProperty(required = true, value = "厂商简称",notes = "")
@NotBlank
private String nickName ; private String nickName ;
/** 平台地址 */ /** 平台地址 */
@ApiModelProperty(required = true, value = "平台地址",notes = "") @ApiModelProperty(required = true, value = "平台地址",notes = "")
@NotBlank
private String address ; private String address ;
/** 维护单位 */ /** 维护单位 */
@ApiModelProperty(required = true, value = "维护单位",notes = "") @ApiModelProperty(required = true, value = "维护单位",notes = "")
@NotBlank
private String maintenanceUnit ; private String maintenanceUnit ;
} }
...@@ -131,10 +131,12 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -131,10 +131,12 @@ public class StaticInfoServiceImpl implements StaticInfoService {
if (!CollectionUtils.isEmpty(crossIdList)) { if (!CollectionUtils.isEmpty(crossIdList)) {
String crossId = crossIdList.get(0); String crossId = crossIdList.get(0);
CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId); CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId);
if (Objects.nonNull(crossInfoPO)) {
String signalIc = crossInfoPO.getCode(); String signalIc = crossInfoPO.getCode();
wanjiCommonStaticInfoService.schedules(crossId, signalIc); wanjiCommonStaticInfoService.schedules(crossId, signalIc);
} }
} }
}
} }
......
...@@ -4,10 +4,7 @@ import io.swagger.annotations.ApiModel; ...@@ -4,10 +4,7 @@ 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.Max; import javax.validation.constraints.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
/** /**
...@@ -22,6 +19,7 @@ public class ControlCommandVO { ...@@ -22,6 +19,7 @@ public class ControlCommandVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号") @ApiModelProperty(value = "路口编号", notes = "路口编号")
@NotBlank(message = "路口编号不可为空") @NotBlank(message = "路口编号不可为空")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossCode; private String crossCode;
@ApiModelProperty(value = "1是;0否") @ApiModelProperty(value = "1是;0否")
...@@ -30,10 +28,10 @@ public class ControlCommandVO { ...@@ -30,10 +28,10 @@ public class ControlCommandVO {
@Min(value = 0, message = "控制类型:1是;0否") @Min(value = 0, message = "控制类型:1是;0否")
private Integer command; private Integer command;
@ApiModelProperty(value = "持续时间") @ApiModelProperty(value = "持续时间", notes = "持续时间, 可为空,默认999")
private Integer duration; private Integer duration;
@ApiModelProperty(value = "锁定相位列表") @ApiModelProperty(value = "锁定相位列表", notes = "锁定相位列表, 可为空")
private List<Integer> phaseList; private List<Integer> phaseList;
} }
...@@ -7,6 +7,7 @@ import lombok.Setter; ...@@ -7,6 +7,7 @@ import lombok.Setter;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
/** /**
...@@ -22,6 +23,7 @@ public class PhaseTimingSendVO { ...@@ -22,6 +23,7 @@ public class PhaseTimingSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号") @ApiModelProperty(value = "路口编号", notes = "路口编号")
@NotBlank(message = "路口编号不可为空") @NotBlank(message = "路口编号不可为空")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossCode; private String crossCode;
@ApiModelProperty(value = "需要下发的相位列表", notes = "需要下发的相位列表") @ApiModelProperty(value = "需要下发的相位列表", notes = "需要下发的相位列表")
......
...@@ -7,6 +7,7 @@ import lombok.Setter; ...@@ -7,6 +7,7 @@ import lombok.Setter;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
/** /**
...@@ -22,6 +23,7 @@ public class PlanSendVO { ...@@ -22,6 +23,7 @@ public class PlanSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号") @ApiModelProperty(value = "路口编号", notes = "路口编号")
@NotBlank(message = "路口编号不可为空") @NotBlank(message = "路口编号不可为空")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossCode; private String crossCode;
@ApiModelProperty(value = "计划列表", notes = "计划列表") @ApiModelProperty(value = "计划列表", notes = "计划列表")
@NotEmpty(message = "计划列表不可为空") @NotEmpty(message = "计划列表不可为空")
......
...@@ -7,6 +7,7 @@ import lombok.Setter; ...@@ -7,6 +7,7 @@ import lombok.Setter;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
/** /**
...@@ -22,6 +23,7 @@ public class ScheduleSendVO { ...@@ -22,6 +23,7 @@ public class ScheduleSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号") @ApiModelProperty(value = "路口编号", notes = "路口编号")
@NotBlank(message = "路口编号不可为空") @NotBlank(message = "路口编号不可为空")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossCode; private String crossCode;
@ApiModelProperty(value = "时间表", notes = "时间表") @ApiModelProperty(value = "时间表", notes = "时间表")
@NotEmpty(message = "时间表不可为空") @NotEmpty(message = "时间表不可为空")
......
...@@ -22,6 +22,7 @@ public class SchemeSendVO { ...@@ -22,6 +22,7 @@ public class SchemeSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号") @ApiModelProperty(value = "路口编号", notes = "路口编号")
@NotBlank(message = "路口编号不可为空") @NotBlank(message = "路口编号不可为空")
@javax.validation.constraints.Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
private String crossCode; private String crossCode;
@ApiModelProperty(value = "方案列表", notes = "方案列表") @ApiModelProperty(value = "方案列表", notes = "方案列表")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment