package com.izouma.jiashanxia.domain;

import com.izouma.jiashanxia.converter.StringArrayConverter;
import com.izouma.jiashanxia.enums.PackageType;
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.math.BigDecimal;
import java.util.List;

@Data
@Builder
@Entity
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "套餐信息")
public class Package extends BaseEntity {

    @ApiModelProperty(value = "套餐名称")
    private String name;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "套餐标签")
    @Convert(converter = StringArrayConverter.class)
    private List<String> tag;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "详情")
    private String detail;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "套餐类型")
    private PackageType type;

    @ApiModelProperty(value = "图")
    @Column(columnDefinition = "TEXT")
    @Convert(converter = StringArrayConverter.class)
    private List<String> img;

}
