
package com.tmerclub.cloud.common.product.vo;

import com.tmerclub.cloud.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 赠品表VO
 *
 * @author tmerclub
 * @date 2022-08-16 11:11:58
 */
public class GiveawayVO extends BaseVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "赠品id")
    private Long giveawayId;

    @Schema(description = "赠品名称")
    @NotBlank(message = "赠品名称不能为空")
    @Length(max = 20, message = "赠品名称长度不能超过20")
    private String name;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "活动开始时间")
    @NotNull(message = "活动开始时间不能为空")
    private Date startTime;

    @Schema(description = "活动结束时间")
    @NotNull(message = "活动结束时间不能为空")
    private Date endTime;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "主商品id")
    @NotNull(message = "主商品不能为空")
    private Long spuId;

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

    @Schema(description = "主商品图片")
    private String mainImgUrl;

    @Schema(description = "主商品名称")
    private String spuName;

    @Schema(description = "主商品名称")
    private String giveawaySpuName;

    @Schema(description = "购买数量（购买了多少件才赠送赠品）")
    @NotNull(message = "购买数量不能为空")
    private Integer buyNum;

    @Schema(description = "状态 -1：已删除 0：关闭 1:开启 2:未开启")
    private Integer status;

    @Schema(description = "赠送商品列表")
    @Valid
    private List<GiveawaySpuVO> giveawaySpus;

    public Long getGiveawayId() {
        return giveawayId;
    }

    public void setGiveawayId(Long giveawayId) {
        this.giveawayId = giveawayId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public Date getUpdateTime() {
        return updateTime;
    }

    @Override
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getSpuId() {
        return spuId;
    }

    public void setSpuId(Long spuId) {
        this.spuId = spuId;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getMainImgUrl() {
        return mainImgUrl;
    }

    public void setMainImgUrl(String mainImgUrl) {
        this.mainImgUrl = mainImgUrl;
    }

    public String getSpuName() {
        return spuName;
    }

    public void setSpuName(String spuName) {
        this.spuName = spuName;
    }

    public String getGiveawaySpuName() {
        return giveawaySpuName;
    }

    public void setGiveawaySpuName(String giveawaySpuName) {
        this.giveawaySpuName = giveawaySpuName;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<GiveawaySpuVO> getGiveawaySpus() {
        return giveawaySpus;
    }

    public void setGiveawaySpus(List<GiveawaySpuVO> giveawaySpus) {
        this.giveawaySpus = giveawaySpus;
    }

    @Override
    public String toString() {
        return "GiveawayVO{" +
                "giveawayId=" + giveawayId +
                ", name='" + name + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", shopId=" + shopId +
                ", spuId=" + spuId +
                ", price=" + price +
                ", mainImgUrl='" + mainImgUrl + '\'' +
                ", spuName='" + spuName + '\'' +
                ", giveawaySpuName='" + giveawaySpuName + '\'' +
                ", buyNum=" + buyNum +
                ", status=" + status +
                ", giveawaySpus=" + giveawaySpus +
                '}';
    }
}
