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 org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

    /**
     *
     */
    @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("url")
    private String url;

    @ApiModelProperty("视频封面图")
    @TableField("cover_url")
    private String coverUrl;

    @ApiModelProperty("素材类型,0-图片，1-视频，2-音频")
    @TableField("type")
    private Integer type;

    @ApiModelProperty("微信公众号审核状态，0-审核中，1-已通过，2-未通过")
    @TableField("wx_status")
    private Integer wxStatus;

    private String wxPublicMediaId;

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

    @ApiModelProperty("组id")
    private transient Long groupId;

    public transient static Map<Integer, String> FILE_TYPE = new HashMap<Integer, String>() {{
        put(0, "image");
        put(1, "video");
        put(2, "voice");
    }};

}