package com.ruoyi.cms.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 全文索引 ES数据模型
 **/
@IndexName("job_document")
@Data
public class ESJobDocument
{
    /**
     * es中的唯一id
     */
    @IndexId(type = IdType.NONE)
    @JsonIgnore
    private String id;

    /** 公告ID */
    private Long jobId;

    /** 公告标题 */
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String jobTitle;

    /** 内容 */
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String description;

    /** 公告状态 */
    @JsonIgnore
    private String status;

    private Long minSalary;

    /** 最大薪资（元） */
    private Long maxSalary;

    /** 学历要求 对应字典education */
    private String education;

    /** 工作经验要求 对应字典experience */
    private String experience;

    /** 用人单位名称 */
    private String companyName;

    /** 工作地点 */
    private String jobLocation;

    private Integer jobLocationAreaCode;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date postingDate;

    /** 招聘人数 */
    private Long vacancies;

    /** 纬度 */
    private BigDecimal latitude;

    /** 经度 */
    private BigDecimal longitude;

    /** 浏览量 */
    private Long view;

    /** 公司id */
    private Long companyId;

    private Integer isHot;

    private Integer applyNum;
    @JsonIgnore
    private Company company;

    private Integer isApply;

    private Integer isCollection;

    private String dataSource;

    private String jobUrl;
    @JsonIgnore
    @IndexField(fieldType = FieldType.GEO_POINT)
    private String latAndLon;
    @JsonIgnore
    private String scaleDictCode;

    private String industry;

    private String jobCategory;
    @JsonIgnore
    private Integer education_int;
    @JsonIgnore
    private Integer experience_int;
//    @JsonIgnore
    private Integer scale;

    private String appJobUrl;

    private String companyNature;

    private Integer isExplain;
    private String explainUrl;
    private String cover;
}
