package com.izouma.jmrh.domain;

import com.izouma.jmrh.converter.StringArrayConverter;
import com.izouma.jmrh.enums.AuditStatus;
import com.izouma.jmrh.enums.OrgStatus;
import com.izouma.jmrh.enums.PapersType;
import com.izouma.jmrh.enums.PostType;
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.time.LocalDateTime;
import java.util.List;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("帖子")
public class Post extends BaseEntity {

    private Long userId;

    private String title;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("手机")
    private String phone;

    @ApiModelProperty("职业")
    private String profession;

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

    @ApiModelProperty("证件类型")
    @Enumerated(EnumType.STRING)
    private PapersType papersType;

    @ApiModelProperty("证件编号")
    private String papersCode;

    @Column(columnDefinition = "TEXT")
    private String content;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = StringArrayConverter.class)
    private List<String> pics;

    @Enumerated(EnumType.STRING)
    private PostType type;

    private int commentNum;

    private int viewNum;

    private int likeNum;

    private int dislikeNum;

    @Enumerated(EnumType.STRING)
    private AuditStatus status;

    private boolean publicPost;

    private boolean del;

    @ApiModelProperty("审核时间")
    private LocalDateTime auditTime;
}
