package com.elab.es.model;

import com.elab.core.dao.row.ColumnMapping;
import org.zxp.esclientrhl.annotation.ESID;
import org.zxp.esclientrhl.annotation.ESMetaData;

import javax.persistence.Table;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * 测试
 *
 * @author Liukx
 * @create 2020-03-24 13:58
 * @email liukx@elab-plus.com
 **/
@ESMetaData(indexName = "posts", indexType = "_doc", printLog = true)
@Table(name = "posts")
public class Posts implements ColumnMapping {


    @Override
    public void mappingColumn(ResultSet rs) throws SQLException {
        System.out.println("===>>>" + rs);
    }

    @ESID
    private String id;

    private String user;

    private Date postDate;

    private String message;

    public Posts(String user, String message) {
        this.user = user;
        this.message = message;
        this.postDate = new Date();
    }

    public Posts() {
    }

    public String getId() {
        return id;
    }

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

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public Date getPostDate() {
        return postDate;
    }

    public void setPostDate(Date postDate) {
        this.postDate = postDate;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
