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

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 com.yida.data.common.core.entity.notice.EduNoticeSchool;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * Entity
 *
 * @author zhanghaijun
 * @date 2021-07-19 17:21:58
 */
@Data
@TableName("edu_school_home_announcement")
public class EduSchoolHomeAnnouncement {

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

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

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

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

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

    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    @ApiModelProperty("区域名称")
    @TableField("name")
    private String name;

    @ApiModelProperty("显示条数")
    @TableField("show_num")
    private Integer showNum;

    @ApiModelProperty("置顶公告id")
    @TableField("top_announcement_id")
    private Long topAnnouncementId;

    @ApiModelProperty("置顶公告名称")
    private String topAnnouncementName;

    @ApiModelProperty("该部分在app中的区域位id")
    private String yidaAppRegionId;

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

    private transient List<EduNoticeSchool> manuscriptList;

    @ApiModelProperty("置顶公告发布时间")
    private transient LocalDateTime topAnnouncementPubDate;

    @ApiModelProperty("置顶公告正文")
    private transient String topAnnouncementContent;

    private transient EduNoticeSchool topAnnouncement;

}