mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
添加枚举类验证。
This commit is contained in:
parent
af4290784e
commit
7d6737479c
@ -1,11 +1,14 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
@ -21,6 +24,7 @@ public class NotifyMessageBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true)
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
@InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
|
@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 站内信模版 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
@ -26,6 +28,7 @@ public class NotifyTemplateBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "状态:1-启用 0-禁用", required = true)
|
||||
@NotNull(message = "状态:1-启用 0-禁用不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
|
Loading…
Reference in New Issue
Block a user