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

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yida.data.common.core.enums.LikeMarkEnum;
import com.yida.data.common.core.enums.WorkTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 图集详情管理
 *
 * @author ZYJ
 * @date 2021/9/1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("core_atlas_management_details")
public class CoreAtlasManagementDetails implements Serializable {

    private static final long serialVersionUID = -6846302743399222536L;

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

    /**
     * 学校id
     */
    private Long schoolId;

    /**
     * 对应的图集id
     */
    private Long coreAtlasManagementId;

    /**
     * 图集类型：0图片，1视频 {@link WorkTypeEnum}
     */
    private String type;

    /**
     * 图片或视频路径
     */
    private String filePathUrl;

    /**
     * 视频封面图路径
     */
    private String videoImgUrl;

    /**
     * 视频时长
     */
    private String videoTime;

    /**
     * 视频或图片描述
     */
    private String description;

    /**
     * 点赞数
     */
    private Integer likeNum;

    /**
     * 转发数
     */
    private Integer forwardNum;

    /**
     * 评论数
     */
    private Integer commentNum;

    /**
     * 创建人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;

    /**
     * 最后修改人id
     */
    @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;

    /**
     * 删除标识. 0: 未删除, 1: 已删除
     */
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    /**
     * 是否点赞标记: 0未点赞, 1已点赞 {@link LikeMarkEnum}
     */
    @TableField(exist = false)
    private String likeMark;
}