package com.zm.order.tool.server.model;

import com.alibaba.fastjson.JSON;

import java.util.Date;

/**
 * kafka统一消费模型
 *
 * @author nianchang
 * @date 2021/06/09 3:01 下午
 */
public class KafkaConsumerMessage {

    /**
     * 时间
     */
    private Date ts;

    /**
     * 分区键
     */
    private String pks;

    /**
     * mysql主机地址
     */
    private String host;

    /**
     * 数据更新类型
     * insert update delete
     */
    private String type;

    /**
     * 数据表
     */
    private String table;

    /**
     * 数据库
     */
    private String database;

    /**
     * json格式
     * 数据变更前的数据
     */
    private String old;

    /**
     * json格式
     * 数据变更后的数据
     */
    private String data;

    /**
     * 版本
     */
    private String version;

    public Date getTs() {
        return ts;
    }

    public void setTs(Date ts) {
        this.ts = ts;
    }

    public String getPks() {
        return pks;
    }

    public void setPks(String pks) {
        this.pks = pks;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getType() {
        return type;
    }

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

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getOld() {
        return old;
    }

    public void setOld(String old) {
        this.old = old;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
