package com.izouma.nineth.domain;

import com.izouma.nineth.converter.LongArrayConverter;
import com.izouma.nineth.converter.StringArrayConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("空投")
public class AirDrop extends BaseEntity {

    @ApiModelProperty("空投")
    private String name;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("空投类型")
    private String type;

    @ApiModelProperty("兑换券名称")
    private String couponName;

    @ApiModelProperty("兑换券备注")
    private String couponRemark;

    private boolean couponLimited;

    private boolean couponNeedGas;

    @Convert(converter = LongArrayConverter.class)
    @Column(columnDefinition = "TEXT")
    private List<Long> couponCollectionIds;

    private LocalDateTime couponExpiration;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = StringArrayConverter.class)
    @ApiModelProperty("手机号")
    private List<String> phone;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = LongArrayConverter.class)
    @ApiModelProperty("用户ID")
    private List<Long> userIds;

    @ApiModelProperty("藏品ID")
    private Long collectionId;

    @Column(columnDefinition = "TEXT")
    private String result;
}
