package com.czg.product.param;

import com.czg.validator.group.DefaultGroup;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 商品上下架参数
 *
 * @author tankaikai
 * @since 2025-02-18 17:46
 */
@Data
public class ProductIsAutoSaleParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    /**
     * 商品id
     */
    @NotNull(message = "商品id能为空", groups = DefaultGroup.class)
    private Long id;

    /**
     * 是否上下架 1-上架，0-下架
     */
    @NotNull(message = "自动售罄不能为空", groups = DefaultGroup.class)
    @Min(value = 0, message = "自动售罄必须是0或1", groups = DefaultGroup.class)
    @Max(value = 1, message = "自动售罄必须是0或1", groups = DefaultGroup.class)
    private Integer isAutoSoldStock;


}
