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 int code;
    private Boolean result;

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

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


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