package com.pcloud.book.es.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.Date;

/**
 * @Description
 * @Author ruansiyuan
 * @Date 2019/6/13 16:03
 **/
@Document(indexName = "book", type = "news")
public class ESNews {

    @Id
    private String id;

    /**
     * 类型
     */
    private String type;

    /**
     * 来源
     */
    private String newsFrom;

    /**
     * 标题
     */
    private String title;

    /**
     * 发布者
     */
    private String publisher;

    /**
     * 链接
     */
    private String url;

    /**
     * 短链接
     */
    private String shortUrl;

    /**
     * 发布日期
     */
    private String newsDate;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNewsFrom() {
        return newsFrom;
    }

    public void setNewsFrom(String newsFrom) {
        this.newsFrom = newsFrom;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getShortUrl() {
        return shortUrl;
    }

    public void setShortUrl(String shortUrl) {
        this.shortUrl = shortUrl;
    }

    public String getNewsDate() {
        return newsDate;
    }

    public void setNewsDate(String newsDate) {
        this.newsDate = newsDate;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "ESNews{" +
                "id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", newsFrom='" + newsFrom + '\'' +
                ", title='" + title + '\'' +
                ", publisher='" + publisher + '\'' +
                ", url='" + url + '\'' +
                ", shortUrl='" + shortUrl + '\'' +
                ", newsDate='" + newsDate + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
