package com.izouma.zhirongip.domain.supply;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.izouma.zhirongip.annotations.Searchable;
import com.izouma.zhirongip.converter.LongArrayConverter;
import com.izouma.zhirongip.domain.BaseEntity;
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.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel(value = "服务机构")
@Where(clause = "del = 0")
public class ServiceProvider extends BaseEntity {
    @ExcelIgnore
    private Long userId;

    @Searchable
    @ApiModelProperty(value = "机构名称")
    private String name;

    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "机构简介")
    private String introduction;

    @ExcelIgnore
    @ApiModelProperty(value = "服务机构logo")
    private String logo;

    /*
    setting，最多选择三个
     */
    @ExcelIgnore
    @Convert(converter = LongArrayConverter.class)
    @ApiModelProperty(value = "擅长领域")
    private List<Long> field;

    /*
    包括产品型能、应用场景、预期效益
     */
    @ExcelIgnore
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "服务内容列表")
    private String content;

    @ExcelIgnore
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "服务案例")
    private String example;

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

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

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

    @ApiModelProperty(value = "联系地址")
    private String address;

    @Transient
    private List<String> fieldName;

}
