package com.seer.teach.mall.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  商品表实体类
 * </p>
 *
 * @author Captain
 * @since 2025-06-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Schema(description = "商品返回实体类")
public class GoodsResp{

    @Schema(description = "商品ID")
    private Integer id;

    @Schema(description = "商品所属分类的ID")
    private Integer categoryId;

    @Schema(description = "商品的唯一编号")
    private String goodsSn;

    @Schema(description = "商品的名称")
    private String name;

    @Schema(description = "商品的库存数量")
    private Integer goodsNumber;

    @Schema(description = "商品的关键词，用于搜索")
    private String keywords;

    @Schema(description = "商品简介")
    private String goodsBrief;

    @Schema(description = "是否为新品")
    private Integer isNew;

    @Schema(description = "是否热销")
    private Integer isHot;

    /**
     * 是否虚拟产品：0-否 1-是
     */
    @Schema(description = "是否虚拟产品：0-否 1-是")
    private Integer isVirtual;

    /**
     * 商品是否为限量商品，1 表示是，0 表示不是
     */
    @Schema(description = "商品是否为限量商品，1 表示是，0 表示不是")
    private Integer isLimited;

    /**
     * 商品配送方式：0-快递配送 1-自提
     */
    @Schema(description = "商品配送方式：0-快递配送 1-自提")
    private Integer deliveryType;

    @Schema(description = "支付模式：0-线上支付 1-线下支付")
    private Integer paymentMode;

    @Schema(description = "虚拟销量")
    private Long virtualSellVolume;

    @Schema(description = "是否特价优惠")
    private Integer isSpecialOffer;

    @Schema(description = "是否精品推荐")
    private Integer isFeaturedRecommend;

    @Schema(description = "商品的详细描述")
    @TableField("goods_desc")
    private String goodsDesc;

    @Schema(description = "规格类型：0 单规格 1 多规格")
    private Integer specType;

    @Schema(description = "商品销量")
    private Long salesCount;

    @Schema(description = "商品库存")
    private Long stock;

    @Schema(description = "商品是否上架销售，1 表示上架，0 表示下架")
    private Integer isOnSale;

    @Schema(description = "商品类型, bm000001 文件  bm000002 数码产品  bm000003 生活用品  bm000004 食品  bm000005 服饰  bm000006 其他  bm000007 生鲜类  bm000008 易碎品  bm000009 液体")
    private String goodsType;

    @Schema(description = "商品上架时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime onSaleTime;

    @Schema(description = "商品下架时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime offSaleTime;

    @Schema(description = "商品在列表中的排序顺序")
    private Integer sortOrder;

    @Schema(description = "商品是否已删除，1 表示已删除，0 表示未删除")
    @TableField("is_delete")
    private Integer isDelete;

    @Schema(description = "商品属性的分类ID")
    private Integer attributeCategory;

    @Schema(description = "商品的主图片链接")
    private String primaryPicUrl;

    @Schema(description = "商品在列表中展示的图片链接")
    private List<String> listPicUrl;

    @Schema(description = "商品的价格")
    private BigDecimal price;

    /**
     * 商品的状态：0-待审核 1-审核通过，2：审核拒绝
     */
    @Schema(description = "商品的状态：0-待审核 1-审核通过，2：审核拒绝")
    private Integer status;

    /**
     * 商家用户ID
     */
    @Schema(description = "商家用户ID")
    private Long merchantUserId;

    @Schema(description = "租户ID")
    private String tenantId;

    @Schema(description = "商品规格列表")
    private List<GoodsSpecificationResp> specifications;
}
