package shop.alien.entity.second;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 二手商品
 */
@Data
@JsonInclude
@TableName("second_goods")
public class SecondGoods implements Serializable {
    private static final long serialVersionUID = 1L;

    // 商品状态常量
    public static final int STATUS_DRAFT = 0; // 草稿
    public static final int STATUS_REVIEWING = 1; // 审核中
    public static final int STATUS_REVIEW_FAILED = 2; // 审核失败
    public static final int STATUS_ON_SALE = 3; // 已上架
    public static final int STATUS_OFF_SALE = 4; // 已下架
    public static final int STATUS_SOLD_OUT = 5; // 已售出

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

    @TableField("user_id")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @TableField("title")
    @ApiModelProperty(value = "商品标题")
    private String title;

    @TableField("home_image")
    @ApiModelProperty(value = "商品封面图片")
    private String homeImage;

    @TableField("video_first_frame")
    @ApiModelProperty(value = "视频第一帧图片")
    private String videoFirstFrame;

    @TableField("description")
    @ApiModelProperty(value = "商品描述")
    private String description;

    @TableField("price")
    @ApiModelProperty(value = "商品价格（元，保留小数后两位）")
    private String price;

    @TableField("price")
    @ApiModelProperty(value = "商品价格（元，保留小数后两位）")
    private BigDecimal amount;

    @TableField(exist = false)
    private Integer auditRecordId;

    @TableField("position")
    @ApiModelProperty(value = "商品位置")
    private String position;

    @TableField("address_text")
    @ApiModelProperty(value = "地址文本")
    private String addressText;

    @TableField("like_count")
    @ApiModelProperty(value = "点赞数量")
    private Integer likeCount;

    @TableField("collect_count")
    @ApiModelProperty(value = "收藏数量")
    private Integer collectCount;

    @TableField("category_one_id")
    @ApiModelProperty(value = "一级类别ID")
    private Integer categoryOneId;

    @TableField("category_two_id")
    @ApiModelProperty(value = "二级类别ID")
    private Integer categoryTwoId;

    @TableField("label")
    @ApiModelProperty(value = "标签")
    private String label;

    @TableField("topic")
    @ApiModelProperty(value = "话题（以逗号分隔）")
    private String topic;

    @TableField("trade_id")
    @ApiModelProperty(value = "交易ID")
    private Integer tradeId;

    /**
     * 视频审核任务ID
     */
    private String videoTaskId;

    @TableField("goods_status")
    @ApiModelProperty(value = "商品状态 0:草稿 1:审核中 2:审核失败 3:已上架 4:已下架 5:已售出")
    private Integer goodsStatus;

    @TableField("failed_reason")
    @ApiModelProperty(value = "审核失败原因")
    private String failedReason;

    @TableField("ai_task_id")
    @ApiModelProperty(value = "ai_task_id")
    private String aiTaskId;

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

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

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

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

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

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