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

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

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

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

    /**
     * 稿件标题
     */
    @TableField("title")
    private String title;

    /**
     * 封面类型，0-无，1-右单图，2-三图
     */
    @TableField("cover_type")
    private Integer coverType;

    @ApiModelProperty("封面图地址，多个用‘,’分割")
    private String coverUrl;

    /**
     * 图文内容
     */
    @TableField("content")
    private String content;

    @ApiModelProperty("跳转链接")
    private String contentUrl;
    /**
     * 作者id
     */
    @TableField("author_id")
    private Long authorId;

    @ApiModelProperty("发布位置，0-城市书房, 1-第二课堂(精彩推荐)，2-微信公众号，多个用逗号分割")
    @TableField("publish_path")
    private String publishPath;

    @ApiModelProperty("发布时间")
    @TableField("publish_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime publishDate;

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


    @TableField(exist = false)
    private List<Long> tags;

    @ApiModelProperty("0-存草稿，1-待发送，2-已发送，3-不显示，用于菜单配置")
    @TableField("status")
    private Integer status;

    /**
     * 学校或教育局部门id
     */
    @TableField("school_id")
    private Long schoolId;

    @ApiModelProperty("app端稿件id")
    private String yidaAppMunascriptId;

    @ApiModelProperty("公开的学校通知id")
    private Long noticeSchoolId;

    @ApiModelProperty("稿件类型，0-资讯，1-安全教育，2-政策")
    private Integer type;

    @ApiModelProperty("内容类型： 1-文章，2-文件")
    private Integer contentType;

    private transient String authorName;

    // 新闻区
    public static final String NEWS_PATH = "0";
    // 第二课堂
    public static final String SECOND_CLASS_PATH = "1";
    // 公众号
    public static final String WX_PUBLIC_PATH = "2";
}