新增自定义数据校验
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
@ -15,16 +16,16 @@ public class SysNotice extends BaseEntity
|
||||
|
||||
/** 公告ID */
|
||||
private Long noticeId;
|
||||
|
||||
|
||||
/** 公告标题 */
|
||||
private String noticeTitle;
|
||||
|
||||
|
||||
/** 公告类型(1通知 2公告) */
|
||||
private String noticeType;
|
||||
|
||||
|
||||
/** 公告内容 */
|
||||
private String noticeContent;
|
||||
|
||||
|
||||
/** 公告状态(0正常 1关闭) */
|
||||
private String status;
|
||||
|
||||
@ -43,6 +44,8 @@ public class SysNotice extends BaseEntity
|
||||
this.noticeTitle = noticeTitle;
|
||||
}
|
||||
|
||||
@NotBlank(message = "公告标题不能为空")
|
||||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||
public String getNoticeTitle()
|
||||
{
|
||||
return noticeTitle;
|
||||
@ -77,7 +80,7 @@ public class SysNotice extends BaseEntity
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
Reference in New Issue
Block a user