package com.xzzn.ems.domain;

import com.xzzn.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xzzn.common.annotation.Excel;

/**
 * MQTT云上本地同步日志对象 mqtt_sync_log
 *
 * @author xzzn
 * @date 2025-11-12
 */
public class MqttSyncLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 同步消息唯一标识（与消息中的syncId一致） */
    @Excel(name = "同步消息唯一标识", readConverterExp = "与=消息中的syncId一致")
    private String syncId;

    /** MQTT主题 */
    @Excel(name = "MQTT主题")
    private String topic;

    /** 操作类型：INSERT/UPDATE/DELETE */
    @Excel(name = "操作类型：INSERT/UPDATE/DELETE")
    private String operateType;

    /** 涉及的表名 */
    @Excel(name = "涉及的表名")
    private String tableName;

    /** 同步数据内容（JSON格式） */
    @Excel(name = "同步数据内容", readConverterExp = "J=SON格式")
    private String content;

    /** 处理状态：SUCCESS/FAIL */
    @Excel(name = "处理状态：SUCCESS/FAIL")
    private String status;

    /** 失败原因（status=FAIL时填写） */
    @Excel(name = "失败原因", readConverterExp = "s=tatus=FAIL时填写")
    private String errorMsg;

    /** 同步对象 */
    @Excel(name = "同步对象")
    private String syncObject;

    /** 同步目标 */
    @Excel(name = "同步目标")
    private String target;

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

    public Long getId()
    {
        return id;
    }

    public void setSyncId(String syncId)
    {
        this.syncId = syncId;
    }

    public String getSyncId()
    {
        return syncId;
    }

    public void setTopic(String topic)
    {
        this.topic = topic;
    }

    public String getTopic()
    {
        return topic;
    }

    public void setOperateType(String operateType)
    {
        this.operateType = operateType;
    }

    public String getOperateType()
    {
        return operateType;
    }

    public void setTableName(String tableName)
    {
        this.tableName = tableName;
    }

    public String getTableName()
    {
        return tableName;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public String getContent()
    {
        return content;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setErrorMsg(String errorMsg)
    {
        this.errorMsg = errorMsg;
    }

    public String getErrorMsg()
    {
        return errorMsg;
    }

    public void setSyncObject(String syncObject)
    {
        this.syncObject = syncObject;
    }

    public String getSyncObject()
    {
        return syncObject;
    }

    public void setTarget(String target)
    {
        this.target = target;
    }

    public String getTarget()
    {
        return target;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("syncId", getSyncId())
                .append("topic", getTopic())
                .append("operateType", getOperateType())
                .append("tableName", getTableName())
                .append("content", getContent())
                .append("status", getStatus())
                .append("errorMsg", getErrorMsg())
                .append("syncObject", getSyncObject())
                .append("target", getTarget())
                .append("createTime", getCreateTime())
                .toString();
    }
}
