package com.shkj.wcs.third.rcs.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 第三方返回的结果
 *
 * @author lch
 * @date 2023/02/02
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class RcsThirdResult<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 状态码
     */
    private String code;

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

    /**
     * 数据对象
     */
    private T data;


    public static Boolean isOk(RcsThirdResult result) {
        if (result == null){
            return false;
        }
        if (result.getCode().equals("SUCCESS") ) {
            return true;
        }
        return false;
    }
}
