package com.izouma.jmrh.domain;

import com.izouma.jmrh.annotations.Searchable;
import com.izouma.jmrh.enums.AuditStatus;
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.*;

@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("采编")
public class Editing extends BaseEntity {
    @Searchable
    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("封面")
    private String cover;

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

    @ApiModelProperty("发布")
    private boolean publish;

    @ApiModelProperty("类型")
    private Long typeId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "typeId", referencedColumnName = "id", insertable = false, updatable = false)
    //@JsonIgnore
    private DataType type;

    @ApiModelProperty("一级分类")
    private String mainType;

    @ApiModelProperty("二级分类")
    private String subType;

    @ApiModelProperty("审核状态")
    @Enumerated(EnumType.STRING)
    private AuditStatus status;

    @ApiModelProperty("来源")
    private String source;
}
