package com.red.circle.other.inner.model.dto.material;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户礼物背包.
 * </p>
 *
 * @author pengliang
 * @since 2021-03-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class GiftBackpackDTO implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 主键标识.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /**
   * 用户id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long userId;

  /**
   * 礼物id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long giftId;

  /**
   * 获得数量.
   */
  private Integer obtainQuantity;

  /**
   * 消耗数量.
   */
  private Integer consumeQuantity;

  /**
   * 获得数量.
   */
  public Integer calculationQuantity() {
    return obtainQuantity - consumeQuantity;
  }

}
