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

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.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * Entity
 *
 * @author zhanghaijun
 * @date 2022-04-11 14:44:56
 */
@Data
@TableName("edu_second_class_subject")
public class EduSecondClassSubject {

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

    @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 = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    @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(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

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

    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id")
    @TableField("dept_id")
    private Long deptId;

    /**
     * 主题名称
     */
    @ApiModelProperty(value = "主题名称")
    @TableField("name")
    private String name;

    @ApiModelProperty("图标")
    private String icon;

    @ApiModelProperty("信息类型,0-普通信息流，1-排行榜")
    private Integer type;

    @ApiModelProperty("图文类型，0-无图，1-左图右文，2-右图左文，3-上图下文")
    private Integer contentType;

    @ApiModelProperty("排列方向，0-纵向，1-横向")
    private Integer orientation;

    @ApiModelProperty("单排数量/排行数量")
    private Integer rowNum;

    /**
     * 主题类型（0-首页，1-场馆，3-名师在线）
     */
    @ApiModelProperty(value = "主题类型（0-首页，1-场馆，3-名师在线）")
    private Integer topicType;

    private Integer sort;

    @Getter
    @AllArgsConstructor
    public enum TopicType {
        /**
         * 首页类型
         */
        HOME(0),
        /**
         * 场馆类型
         */
        VENUE(1),
        /**
         * 智慧平台
         */
        PLATFORM(2),
        /**
         * 课程类型
         */
        COURSE(3);
        /**
         * 类型值
         */
        private final Integer value;
    }
}