package cn.com.ty.lift.enterprise.oa.entity;

import cn.com.ty.lift.enterprise.config.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 公司公告
 * </p>
 *
 * @author wcz
 * @since 2019-12-04
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class Announcement extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private Long id;

    /**
     * 公司ID
     */
    @NotNull(message = "维保公司不能为空")
    @Min(value = 1,message = "维保公司有误")
    private Long mtCompanyId;

    /**
     * 标题
     */
    @NotBlank(message = "公告标题不能为空")
    private String title;

    /**
     * 内容
     */
    @NotBlank(message = "公告内容不能为空")
    @Size(min = 1, max = 500, message = "公告内容最多1-500个字")
    private String content;

    /**
     * 发布人
     */
    @NotNull(message = "发布人不能为空")
    @Min(value = 1,message = "发布人有误")
    private Long userId;

    /**
     * 发布时间
     */
    private LocalDateTime postDate;

    @TableField(exist = false)
    private List<String> imgUrls;

}
