package com.izouma.zhirongip.domain.demand;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.zhirongip.annotations.Searchable;
import com.izouma.zhirongip.domain.BaseEntity;
import com.izouma.zhirongip.enums.ApplyStatus;
import com.izouma.zhirongip.enums.CopyrightType;
import com.izouma.zhirongip.enums.TradingMethod;
import com.izouma.zhirongip.utils.excel.EnumExcelConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel(value = "版权/软著/服务")
@Where(clause = "del = 0")
public class CopyrightDemand extends BaseEntity {
    @ExcelIgnore
    private Long userId;

    @Searchable
    @ExcelProperty("作品名称")
    @ApiModelProperty(value = "作品名称")
    private String name;

    /*
    作品类型
    软著类型
    服务类型
     */
    @ExcelIgnore
    @ApiModelProperty(value = "作品类型")
    private Long workType;

    @Searchable
    @ExcelIgnore
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "需求描述")
    private String description;

    /*
    服务没有
     */

    @ApiModelProperty(value = "转移转化方式")
    private String mode;
    @ApiModelProperty(value = "转移转化方式")
    private Long modeId;

    /*
    （万元）
     */
    @ExcelProperty("预算（万元）")
    @ApiModelProperty(value = "预算（万元）")
    private BigDecimal expectedPrice;

    @ExcelIgnore
    @ApiModelProperty(value = "面议")
    private Boolean negotiateDirectly;

    @ExcelProperty("联系人")
    @ApiModelProperty(value = "联系人")
    private String contact;

    @ExcelProperty("电话")
    @ApiModelProperty(value = "电话")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ExcelProperty("所在地区")
    @ApiModelProperty(value = "所在地区")
    private String address;

    @ExcelIgnore
    @ApiModelProperty(value = "版权/软著")
    @Enumerated(EnumType.STRING)
    private CopyrightType type;

    @ExcelProperty("作品类型")
    @Transient
    private String workName;

    @ExcelProperty("浏览量")
    @ApiModelProperty(value = "浏览量")
    private long view;

    @Enumerated(EnumType.STRING)
    private ApplyStatus status;
}