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 java.util.Date;
/**
 * @author lsw
 * @date 2024-05-31
 */
@Data
@TableName(value = "tb_news")
@Accessors(chain = true)
public class News{
    private static final long serialVersionUID = 1L;

    private Long id;

    @NotBlank(message = "标题不能为空")
    @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;

    @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;


}
