添加枚举类验证。

This commit is contained in:
xrcoder 2022-08-06 10:53:36 +08:00
parent af4290784e
commit 7d6737479c
2 changed files with 15 additions and 8 deletions

View File

@ -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 = "标题")

View File

@ -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 = "备注")