package com.yida.data.common.core.entity.notice;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 学校公告
 */
@ApiModel(value = "com-yida-data-common-core-entity-notice-EduNoticeSchool")
@Data
@TableName(value = "edu_notice_school")
public class EduNoticeSchool {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "")
    private Long id;

    @ApiModelProperty(value = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createDate;

    @TableField(value = "create_id", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "")
    private Long createId;

    @TableField(value = "create_name", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "")
    private String createName;

    @ApiModelProperty(value = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateDate;

    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "")
    private Long updateId;

    /**
     * 0-未删除，1-已删除
     */
    @TableField(value = "del_flag")
    @TableLogic(value = "0", delval = "1")
    @ApiModelProperty(value = "0-未删除，1-已删除")
    private Integer delFlag;

    /**
     * 公告标题
     */
    @TableField(value = "title")
    @ApiModelProperty(value = "公告标题")
    private String title;

    /**
     * 公告描述
     */
    @ApiModelProperty("公告描述")
    private String description;

    /**
     * 封面图，图文公告才有
     */
    @TableField(value = "cover_url")
    @ApiModelProperty(value = "封面图，图文公告才有")
    private String coverUrl;

    /**
     * 公告内容，图文为富文本，文字为内容
     */
    @TableField(value = "content")
    @ApiModelProperty(value = "公告内容，图文为富文本，文字为内容")
    private String content;

    /**
     * 公告内容，图片公告的url，用','隔开；视频的url
     */
    @TableField(value = "content_url")
    @ApiModelProperty(value = "公告内容，图片公告的url，用','隔开；视频的url")
    private String contentUrl;

    /**
     * 公告类型,0-图文，1-文本，2-图片，3-视频
     */
    @TableField(value = "`type`")
    @ApiModelProperty(value = "公告类型,0-图文，1-文本，2-图片，3-视频")
    private Integer type;

    /**
     * 定时发送，0-是，1-否
     */
    @TableField(value = "is_timing")
    @ApiModelProperty(value = "定时发送，0-是，1-否")
    private Integer isTiming;

    /**
     * 定时发送时间
     */
    @ApiModelProperty(value = "定时发送时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendDate;

    /**
     * 是否需要确认，0-是，1-否
     */
    @TableField(value = "is_confirm")
    @ApiModelProperty(value = "是否需要确认，0-是，1-否")
    private Integer isConfirm;

    /**
     * 发送状态，0-未发送，1-已发送,2-已撤回
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "发送状态，0-未发送，1-已发送,2-已撤回")
    private Integer status;

    @ApiModelProperty("是否公开，0-不公开，1-公开")
    private Integer isPublic;

    @ApiModelProperty("草稿状态，0-非草稿，1-草稿")
    private Integer isDraft;

    /**
     * 学校id
     */
    @TableField(value = "school_id")
    @ApiModelProperty(value = "学校id")
    private Long schoolId;

    /**
     * 学校名称
     */
    @TableField(value = "school_name")
    @ApiModelProperty(value = "学校名称")
    private String schoolName;

    /**
     * 校区id
     */
    @TableField(value = "campus_id")
    @ApiModelProperty(value = "校区id")
    private Long campusId;

    /**
     * 校区名称
     */
    @TableField(value = "campus_name")
    @ApiModelProperty(value = "校区名称")
    private String campusName;

    private Integer receiverNum;

    @ApiModelProperty(value = "上次编辑时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastEditTime;

    /**
     * 通知接收者列表
     */
    @ApiModelProperty(value = "通知接收者")
    private transient List<EduNoticeSchoolReceiver> receiverList;

    @ApiModelProperty("需要接收的家长列表")
    private transient List<EduNoticeSchoolReceiveStudent> receiveStudentList;
    
}
