package com.ruoyi.web.work.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author 高伟森
 * @date 2024-04-18
 */
@Data
@TableName(value = "tb_notice")
@Accessors(chain = true)
public class Notice{
    private static final long serialVersionUID = 1L;

    private Long id;

    @NotBlank(message = "通知标题不能为空")
    @Size(max = 30, message = "通知标题长度不能超过30个字符")
    @ApiModelProperty(value = "标题")
    private String title;

    @NotBlank(message = "通知类型不能为空")
    @ApiModelProperty(value = "通知类型")
    private String type;

    @NotBlank(message = "通知内容不能为空")
    @ApiModelProperty(value = "内容")
    private String contents;

    @NotNull(message = "是否置顶不能为空")
    @ApiModelProperty(value = "是否置顶")
    private Integer top;

    @NotNull(message = "状态不能为空")
    @ApiModelProperty(value = "状态:0=正常,1=停用")
    private Integer state;

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}
