package com.izouma.nineth.domain;

import com.izouma.nineth.converter.LongArrayConverter;
import com.izouma.nineth.converter.StringArrayConverter;
import com.izouma.nineth.enums.AirDropType;
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.*;
import java.util.List;

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

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

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

    @Enumerated(EnumType.STRING)
    @ApiModelProperty("空投类型")
    private AirDropType type;

    @ApiModelProperty("兑换券ID")
    private Long couponId;

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

    @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;

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