package com.softwarebr.nunu.entity.go;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 政策
 *
 * @author lilin
 * @date 2020-02-19 15:35:44
 */

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "go_policy")
@Builder
public class Policy {

    /**
     * 仅显示
     */
    public final static Integer APPLY_STATUS_DISPLAY = 0;
    /**
     * 可申报
     */
    public final static Integer APPLY_STATUS_YES = 1;

    /**
     * 来源类型1.平台
     */
    public final static Integer SOURCE_TYPE_ADMIN = 1;

    /**
     * 来源类型2.爬虫
     */
    public final static Integer SOURCE_TYPE_REPTILE = 2;


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id", required = true, example = "1")
    private Long id;

    @ApiModelProperty(value = "省份id", required = true, example = "1")
    private Long provinceId;

    @ApiModelProperty(value = "城市id", required = true, example = "1")
    private Long cityId;

    @ApiModelProperty(value = "区域id", required = true, example = "1")
    private Long areaId;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", required = true, example = "2018-03-12 21:32:33")
    private LocalDateTime createDate;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "发布时间", required = true, example = "2018-03-12 21:32:33")
    private LocalDateTime publishDate;

    @ApiModelProperty(value = "来源", required = true, example = "")
    @Column(length = Integer.MAX_VALUE)
    private String source;

    @ApiModelProperty(value = "来源类型(1.平台 2.爬虫)", required = true, example = "")
    private Integer sourceType;

    @ApiModelProperty(value = "政策名称", required = true, example = "")
    private String title;

    @ApiModelProperty(value = "政策详情 ", required = true, example = "")
    @Column(length = Integer.MAX_VALUE)
    private String content;

    @ApiModelProperty(value = "是否推荐至首页(0否 1是)", required = true, example = "")
    private Integer indexType;

    @ApiModelProperty(value = "是否上架(0下架 1上架) ", required = true, example = "")
    private Integer status;

    @ApiModelProperty(value = "审核状态(1待审核 2审核通过 3审核不通过)", required = true, example = "")
    private Integer verify;

    @ApiModelProperty(value = "审核备注", required = true, example = "")
    private String remark;

    @ApiModelProperty(value = "申报状态0.仅显示 1.可申报", required = true, example = "")
    private Integer applyStatus;

    @ApiModelProperty(value = "删除标记0.已删除 1.未删除", required = true, example = "")
    private Integer marker;
}