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_menu")
public class EduSchoolMenu {

    /**
     *
     */
    @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("父菜单id")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty("父菜单名称")
    @TableField("parent_name")
    private String parentName;

    @ApiModelProperty("菜单内容，0-发消息，1-跳转链接，2-跳转栏目,3-空（该菜单为父菜单）")
    private Integer contentType;

    @ApiModelProperty("发消息类型 0-图文，1-图片，2-视频，3-音频")
    private Integer sourceType;

    @ApiModelProperty("图片、音视频地址，跳转链接地址")
    @TableField("url")
    private String url;

    @ApiModelProperty("跳转栏目Id")
    private String colId;

    @ApiModelProperty("稿件id")
    @TableField("manuscript_id")
    private Long manuscriptId;

    @TableField("school_id")
    private Long schoolId;

    @ApiModelProperty("0-家长，1-老师")
    private Integer type;

    public static final Map<Integer, String> CONTENT_TYPE = new HashMap() {{
        put(0, "html");
        put(1, "html");
        put(2, "column");
    }};
}