package com.fzm.mall.server.front.asset.model.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author tdz
 * @date 2021/02/22 11:26
 */
@Data
@ApiModel("订单单位参数")
public class OrderMainUnitDTO {
    @ApiModelProperty("商品编号")
    private String gid;
    private String skuId;
    @ApiModelProperty("商品币种名称")
    private String coin;
    @ApiModelProperty("商品购买数量")
    private String number;
    @ApiModelProperty("提货备注")
    private String note;

    @JsonIgnore
    private String name;
    @JsonIgnore
    private String amount;

    public void setCoin(String coin) {
        if (StringUtils.isNotBlank(coin)) {
            coin = coin.toUpperCase();
        }
        this.coin = coin;
    }

    @Override
    public String toString() {
        return "商品编号: " + gid + ", 商品币种: " + coin + ", 购买数量: " + number;
    }
}
