提交 b57a2da5 作者: 张小凤

LicenseOrganizations(update)

上级 a6d32682
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<dependency> <dependency>
<groupId>org.hibernate.validator</groupId> <groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>6.0.7.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
...@@ -38,4 +39,4 @@ ...@@ -38,4 +39,4 @@
<version>1.5.22</version> <version>1.5.22</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.mmc.csf.licence.vo; package com.mmc.csf.licence.vo;
import com.mmc.csf.release.model.group.Create; import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Page;
import com.mmc.csf.release.model.group.Update; import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.Value;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.*;
import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/** /**
...@@ -63,6 +65,8 @@ public class LicenseOrganizationsVO { ...@@ -63,6 +65,8 @@ public class LicenseOrganizationsVO {
@ApiModelProperty(value = "机构规模id不能为空", example = "1") @ApiModelProperty(value = "机构规模id不能为空", example = "1")
//@NotNull(message = "机构规模id不能为空", groups = {Create.class, Update.class}) //@NotNull(message = "机构规模id不能为空", groups = {Create.class, Update.class})
// @Size(max = 4, message = "机构规模id不能超过4", groups = {Create.class, Update.class})
@Max(value = 4, groups = {Create.class, Update.class},message = "机构规模id不能超过4")
private Integer scaleId; private Integer scaleId;
@ApiModelProperty(value = "机构描述", example = "机构描述0001") @ApiModelProperty(value = "机构描述", example = "机构描述0001")
...@@ -74,7 +78,8 @@ public class LicenseOrganizationsVO { ...@@ -74,7 +78,8 @@ public class LicenseOrganizationsVO {
private String detail; private String detail;
@ApiModelProperty(value = "培训项目", required = true) @ApiModelProperty(value = "培训项目", required = true)
@NotNull(message = "培训项目", groups = {Create.class, Update.class}) @NotNull(message = "培训项目不能为空", groups = {Create.class, Update.class})
@Valid
private List<LicenseTrainingProgramsVO> trainingProgramsVOS; private List<LicenseTrainingProgramsVO> trainingProgramsVOS;
......
...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Range; import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -26,14 +27,17 @@ public class LicenseTrainingProgramsVO { ...@@ -26,14 +27,17 @@ public class LicenseTrainingProgramsVO {
@ApiModelProperty(value = "培训等级id", example = "1", required = true) @ApiModelProperty(value = "培训等级id", example = "1", required = true)
@NotNull(message = "培训等级id不能为空", groups = {Create.class, Update.class}) @NotNull(message = "培训等级id不能为空", groups = {Create.class, Update.class})
@Max(value = 2, groups = {Create.class, Update.class},message = "培训等级id不能超过2")
private Integer gradeId; private Integer gradeId;
@ApiModelProperty(value = "培训机型id", example = "1", required = true) @ApiModelProperty(value = "培训机型id", example = "1", required = true)
@NotNull(message = "培训机型id不能为空", groups = {Create.class, Update.class}) @NotNull(message = "培训机型id不能为空", groups = {Create.class, Update.class})
@Max(value = 4, groups = {Create.class, Update.class},message = "培训机型id不能超过4")
private Integer modelsId; private Integer modelsId;
@ApiModelProperty(value = "培训类型id", example = "1", required = true) @ApiModelProperty(value = "培训类型id", example = "1", required = true)
@NotNull(message = "培训类型id不能为空", groups = {Create.class, Update.class}) @NotNull(message = "培训类型id不能为空", groups = {Create.class, Update.class})
@Max(value = 3, groups = {Create.class, Update.class},message = "培训类型id不能超过3")
private Integer typeId; private Integer typeId;
@ApiModelProperty(value = "培训价格", example = "1000", required = true) @ApiModelProperty(value = "培训价格", example = "1000", required = true)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论