"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiResponse = void 0;
/**
 * 非标接口返回值
 */
class ApiResponse {
    constructor(resCode, resMsg, data) {
        this.resCode = resCode;
        this.resMsg = resMsg;
        this.data = data;
    }
    static isSuccess(res) {
        return res.resCode === "0" || res.resCode === 0;
    }
    static successWithData(data) {
        return new ApiResponse("0", null, data);
    }
    static successWithResMsg(resMsg) {
        return new ApiResponse("0", resMsg);
    }
    static failed(resMsg) {
        return new ApiResponse("-1", resMsg);
    }
}
exports.ApiResponse = ApiResponse;
ApiResponse.success = new ApiResponse("0");
