package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author wangchen create 2023/7/28 16:44
 */
@Entity
@Table(name = "ycq_headline_article")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of= {"headlineId"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "青春头条文章信息")
public class YcqHeadlineArticle implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "idGenerator")
    @Column(name = "headline_id")
    @ApiModelProperty(value = "主键")
    private Long headlineId;

    @Column(name = "headline_article_id")
    @ApiModelProperty(value = "头条文章id")
    private String headlineArticleId;

    @Column(name = "headline_title")
    @ApiModelProperty(value = "文章标题")
    private String headlineTitle;

    @Column(name = "article_abstract")
    @ApiModelProperty(value = "文章摘要")
    private String articleAbstract;

    @Column(name = "cover_pic")
    @ApiModelProperty(value = "封面图片")
    private String coverPic;

    @Column(name = "headline_article_context")
    @ApiModelProperty(value = "文章内容")
    private String headlineArticleContext;

    @Column(name = "column_two")
    @ApiModelProperty(value = "二级栏目")
    private String columnTwo;

    @Column(name = "push_time")
    @ApiModelProperty(value = "推送时间")
    private Date pushTime;

    @Column(name = "release_time")
    @ApiModelProperty(value = "推送时间")
    private Date releaseTime;

    @Column(name = "article_source")
    @ApiModelProperty(value = "来源")
    private String articleSource;

    @Column(name = "state")
    @ApiModelProperty(value = "状态")
    private Integer state;

    @Column(name = "likes_count")
    @ApiModelProperty(value = "点赞量")
    private Long likesCount;

    @Column(name = "reading_quantity")
    @ApiModelProperty(value = "阅读量")
    private Long readingQuantity;

    @Column(name = "is_top")
    @ApiModelProperty(value = "是否置顶")
    private String isTop;

    @Column(name = "resource_pic")
    @ApiModelProperty(value = "封面源图片")
    private String resourcePic;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
}
