package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import shop.alien.entity.store.dto.deserializer.JsonStringDeserializer;

import java.util.Date;

/**
 * 门店视频
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude
@TableName("store_video")
@ApiModel(value = "StoreVideo对象", description = "门店视频")
public class StoreVideo extends Model<StoreVideo> {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "门店id")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "视频描述")
    @TableField("img_description")
    private String imgDescription;

    @ApiModelProperty(value = "视频排序")
    @TableField("img_sort")
    private Integer imgSort;

    @ApiModelProperty(value = "视频链接和封面地址")
    @TableField("img_url")
    @JsonDeserialize(using = JsonStringDeserializer.class)
    private String imgUrl;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "业务ID|相册（store_official_album）ID")
    @TableField("business_id")
    private Integer businessId;
}

