package com.xinelu.manage.domain.goodsAttributeDetails;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商品属性明细对象 goods_attribute_details
 *
 * @author xinyilu
 * @date 2022-10-17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品属性明细对象", description = "goods_attribute_details")
public class GoodsAttributeDetails extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -1338498896375073750L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 商品属性id
     */
    @ApiModelProperty(value = "商品属性id")
    @Excel(name = "商品属性id")
    private Long goodsAttributeId;

    /**
     * 商品属性明细名称
     */
    @ApiModelProperty(value = "商品属性明细名称")
    @Excel(name = "商品属性明细名称")
    @NotBlank(message = "商品属性明细名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "商品属性明细名称不能超过100位", groups = {Insert.class, Update.class})
    private String attributeDetailsName;

    /**
     * 库存数量
     */
    @ApiModelProperty(value = "库存数量")
    @Excel(name = "库存数量")
    @NotNull(message = "库存数量不能为空", groups = {Insert.class, Update.class})
    private Integer goodsStock;

    /**
     * 商品单价，保留到小数点后两位
     */
    @ApiModelProperty(value = "商品单价，保留到小数点后两位")
    @Excel(name = "商品单价，保留到小数点后两位")
    @NotNull(message = "商品单价不能为空", groups = {Insert.class, Update.class})
    private BigDecimal goodsPrice;

    /**
     * 商品属性图片地址
     */
    @ApiModelProperty(value = "商品属性图片地址")
    @Excel(name = "商品属性图片地址")
    @Length(max = 200, message = "商品属性图片地址不能超过200位", groups = {Insert.class, Update.class})
    private String attributePitureUrl;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    private Integer sort;

    /**
     * 积分兑换标识，0：否，1：是
     */
    @ApiModelProperty(value = "积分兑换标识，0：否，1：是")
    @Excel(name = "积分兑换标识，0：否，1：是")
    private Integer integralExchangeFlag;

    /**
     * 积分兑换门槛值
     */
    @ApiModelProperty(value = "积分兑换门槛值")
    @Excel(name = "积分兑换门槛值")
    private Integer integralExchangeSill;

    /**
     * 积分兑换商品数量
     */
    @ApiModelProperty(value = "积分兑换商品数量")
    @Excel(name = "积分兑换商品数量")
    private Integer integralExchangeCount;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("goodsAttributeId", getGoodsAttributeId())
                .append("attributeDetailsName", getAttributeDetailsName())
                .append("goodsStock", getGoodsStock())
                .append("goodsPrice", getGoodsPrice())
                .append("attributePitureUrl", getAttributePitureUrl())
                .append("sort", getSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
