package cn.axzo.msg.center.notices.integration.dto.response;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @description
 *  联麓渠道基础的响应数据结构
 *
 * @author cold_blade
 * @date 2023/9/7
 * @version 1.0
 */
@Setter
@Getter
public class LianLuBaseResponse implements Serializable {

    private static final long serialVersionUID = -5569752741534086993L;

    private static final String SUCCESS_STATUS = "00";

    /**
     * 请求ID
     */
    private String taskId;

    /**
     * 接口请求状态码
     * @see <a href="接口请求状态码">https://www.shlianlu.com/console/document/errorCode</a>
     */
    private String status;

    /**
     * 返回信息
     */
    private String message;

    /**
     * UNIX 时间戳
     */
    private String timestamp;

    /**
     * 请求ID
     */
    private String requestId;

    public boolean isSuccess() {
        return SUCCESS_STATUS.equals(this.status);
    }

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