"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiClient = void 0;
var axios_1 = require("axios");
var uuid_1 = require("uuid");
var SignUtil_1 = require("./SignUtil");
var Dto_1 = require("./Dto");
/**
 * 统一接口客户端
 */
var ApiClient = /** @class */ (function () {
    function ApiClient(opts) {
        var axiosInstance = axios_1.default.create({
            baseURL: opts.url,
            timeout: opts.timeout || 20 * 1000,
            headers: {
                "Content-Type": "application/json;charset=utf-8",
                version: opts.version || "1.0.0",
                "accept-language": opts.lang || "zh-CN",
            },
        });
        axiosInstance.interceptors.request.use(function (config) {
            var headers = config.headers || {};
            if (!headers["trace-id"])
                headers["trace-id"] = uuid_1.v4();
            config.headers = headers;
            var data = (config.data || {});
            //填充serviceCode
            if (!data.serviceCode && config.url) {
                var serviceCode = config.url.split("/").pop();
                data.serviceCode =
                    serviceCode.charAt(0).toLowerCase() + serviceCode.slice(1);
            }
            //签名
            if (!data.key) {
                data.appId = opts.appId;
                if (!data.reqId)
                    data.reqId = uuid_1.v4();
                data.ts = Date.now().toString();
                data.key = SignUtil_1.SignUtil.sign(data, opts.appSecret);
            }
            config.data = data;
            return config;
        });
        this.axiosInstance = axiosInstance;
    }
    ApiClient.prototype.post = function (url, data, config) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.axiosInstance.post(url, data, config)];
                    case 1:
                        res = _a.sent();
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.0.1 获取平台配置信息
     */
    ApiClient.prototype.getConfigInfo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("config/platform/GetConfigInfo", null, { apiDesc: "2.0.1获取平台配置信息" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * SQL通道-list
     * @param sql
     * @param parkId
     * @param timeout 超时时间(毫秒)
     * @returns
     */
    ApiClient.prototype.list = function (sql, parkId, timeout) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("dbproxy/list", { parkId: parkId, sql: sql }, {
                            headers: { "kt-lotcodes": parkId, version: "1.0" },
                            apiDesc: "sql通道-list",
                            timeout: timeout,
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * SQL通道-selectOne
     * @param sql
     * @param parkId
     * @param timeout 超时时间(毫秒)，默认20秒
     * @returns
     */
    ApiClient.prototype.selectOne = function (sql, parkId, timeout) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("dbproxy/selectOne", { parkId: parkId, sql: sql }, {
                            headers: { "kt-lotcodes": parkId, version: "1.0" },
                            apiDesc: "sql通道-selectOne",
                            timeout: timeout,
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * SQL通道-execute
     */
    ApiClient.prototype.execute = function (sql, parkId, openTx, timeout) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("dbproxy/execute", {
                            sqlList: typeof sql === "string" ? [sql] : sql,
                            parkId: parkId,
                            openTx: openTx,
                        }, {
                            headers: { "kt-lotcodes": parkId, version: "1.0" },
                            apiDesc: "sql通道-execute",
                            timeout: timeout,
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.1.1获取停车场列表
     */
    ApiClient.prototype.getParkingLotList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingLotList", request, {
                            apiDesc: "2.1.1获取停车场列表",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.1.2停车场信息查询接口
     */
    ApiClient.prototype.getParkingLotInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingLotInfo", request, {
                            apiDesc: "2.1.2停车场信息查询接口",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.1.3车场终端设备查询接口
     * 获取车场终端设备信息列表
     */
    ApiClient.prototype.getDeviceList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetDeviceList", request, {
                            apiDesc: "2.1.3车场终端设备查询接口",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.1.5通道信息
     * 获取通道信息
     */
    ApiClient.prototype.getParkingNode = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingNode", request, {
                            apiDesc: "2.1.5通道信息",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.1.6停车场信息查询扩展接口
     */
    ApiClient.prototype.getParkingLotInfoExt = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingLotInfoExt", request, {
                            apiDesc: "2.1.6停车场信息查询扩展接口",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.2.1固定车新增接口
     */
    ApiClient.prototype.addCarCardNo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/AddCarCardNo", request, {
                            apiDesc: "2.2.1固定车新增接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.2固定车查询接口
     */
    ApiClient.prototype.getCarCardInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetCarCardInfo", request, {
                            apiDesc: "2.2.2固定车查询接口",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.2.3固定车修改接口
     */
    ApiClient.prototype.modifyCarCardNo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/ModifyCarCardNo", request, {
                            apiDesc: "2.2.3固定车修改接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.4固定车删除接口
     */
    ApiClient.prototype.delCarCardInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/DelCarCardInfo", request, {
                            apiDesc: "2.2.4固定车删除接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.6固定车充值接口
     */
    ApiClient.prototype.payCarCardFee = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/PayCarCardFee", request, {
                            apiDesc: "2.2.6固定车充值接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
    * 2.2.7 获取图片存储根地址
    */
    ApiClient.prototype.getImageBaseUrl = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/normal/getImageBaseUrl', request, { apiDesc: '2.2.7 获取图片存储根地址' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getCarCardChargeList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetCarCardChargeList", request, {
                            apiDesc: "2.2.8查询固定车充值信息",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.2.9固定车退款接口
     */
    ApiClient.prototype.refundCarCardFee = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/RefundCarCardFee", request, {
                            apiDesc: "2.2.9固定车退款接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.10固定车审核
     */
    ApiClient.prototype.auditCardRecharge = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/AuditCardRecharge", request, {
                            apiDesc: "2.2.10固定车审核",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.11固定车充值开票
     */
    ApiClient.prototype.rechargeInvoice = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/RechargeInvoice", request, {
                            apiDesc: "2.2.11固定车充值开票",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.2.12内部车注销恢复
     */
    ApiClient.prototype.modifyCardStatus = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/ModifyCardStatus", request, {
                            apiDesc: "2.2.12内部车注销恢复",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.3.1查询进出记录
     */
    ApiClient.prototype.getCarInoutInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetCarInoutInfo", request, {
                            apiDesc: "2.3.1查询进出记录",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.3.2查询缴费记录
     */
    ApiClient.prototype.getParkingPaymentList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingPaymentList", request, { apiDesc: "2.3.2查询缴费记录" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.3.4获取缴费记录上报所需要的数据
     */
    ApiClient.prototype.getUploadPayList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetUploadPayList", request, {
                            apiDesc: "2.3.4获取缴费记录上报所需要的数据",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.4.1用户车位预订
     *
     * 返回的是json字符串，需要手动转对象
     */
    ApiClient.prototype.reserveSpace = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/find/ReserveSpace", request, {
                            apiDesc: "2.4.1用户车位预订",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.4.2修改预约车有效期
     */
    ApiClient.prototype.reserveSpace_ChangeTime = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/find/ReserveSpace_ChangeTime", request, {
                            apiDesc: "2.4.2修改预约车有效期",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.4.3车位预订取消接口
     */
    ApiClient.prototype.cancelReserveSpace = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/find/CancelReserveSpace", request, {
                            apiDesc: "2.4.3车位预订取消接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.4.4预订车位查询接口
     */
    ApiClient.prototype.getReservableInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/find/GetReservableInfo", request, {
                            apiDesc: "2.4.4预订车位查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
       * 2.4.6 在场车辆清理
       */
    ApiClient.prototype.carLeave = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/carcome/carLeave', request, { apiDesc: '2.4.6 在场车辆清理' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
   * 2.4.9 下发服务时间
   */
    ApiClient.prototype.pushServiceDate = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                return [2 /*return*/, this.post('nkcInnerApi/control/pushServiceDate', request, { apiDesc: '2.4.9 下发服务时间' })];
            });
        });
    };
    /**
       * 2.4.12 出口识别车牌修改
       */
    ApiClient.prototype.carInModify = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/control/carInModify', request, { apiDesc: '2.4.12 出口识别车牌修改' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
       * 2.4.12 出口识别车牌修改
       */
    ApiClient.prototype.carOutModify = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/control/carOutModify', request, { apiDesc: '2.4.12 出口识别车牌修改' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.1账单查询/费用查询
     *
     * data是json字符串(如果有值),需要进行转换GetParkingPaymentInfoRequest
     */
    ApiClient.prototype.getParkingPaymentInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingPaymentInfo", request, {
                            apiDesc: "2.5.1账单查询/费用查询",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.2停车费支付
     */
    ApiClient.prototype.payParkingFee = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/PayParkingFee", request, {
                            apiDesc: "2.5.2停车费支付",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.3查询订单状态
     */
    ApiClient.prototype.getOrderStatus = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetOrderStatus", request, {
                            apiDesc: "2.5.3查询订单状态",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.4充电桩抵扣
     */
    ApiClient.prototype.syncChargePilePay = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/SyncChargePilePay", request, {
                            apiDesc: "2.5.4充电桩抵扣",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.5无牌车扫出入口二维码进出场
     */
    ApiClient.prototype.unlicensedCarInout = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                return [2 /*return*/, this.post("api/wec/UnlicensedCarInout", request, {
                        apiDesc: "2.5.5无牌车扫出入口二维码进出场",
                    })];
            });
        });
    };
    /**
     * 2.5.6车辆无感支付签约变更通知接口
     */
    ApiClient.prototype.signing = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                return [2 /*return*/, this.post("api/nosense/Signing", request, {
                        apiDesc: "2.5.6车辆无感支付签约变更通知接口",
                    })];
            });
        });
    };
    ApiClient.prototype.getInvoiceData = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetInvoiceData", request, {
                            apiDesc: "2.5.9获取可开票的缴费记录",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.syncInvoiceInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/SyncInvoiceInfo", request, {
                            apiDesc: "2.5.10同步开票信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.cancelInvoice = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/CancelInvoice", request, {
                            apiDesc: "2.5.11取消开票信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.syncRefundState = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/SyncRefundState", request, {
                            apiDesc: "2.5.14退款状态同步",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.syncRefundAudit = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/SyncRefundAudit", request, {
                            apiDesc: "2.5.15退款审核状态下发(审核流程)",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.5.17 获取计费详情GetFeeDetailRes
     */
    ApiClient.prototype.getFeeDetail = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("nkcInnerApi/bill/getFeeDetail", request, {
                            apiDesc: "2.5.17 获取计费详情",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.6.1在场车辆查询
     */
    ApiClient.prototype.queryCarInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/QueryCarInfo", request, {
                            apiDesc: "2.6.1在场车辆查询",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.6.2剩余车位查询GetFreeSpaceNumResponse
     */
    ApiClient.prototype.getFreeSpaceNum = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetFreeSpaceNum", request, {
                            apiDesc: "2.6.2剩余车位查询",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.6.3设备状态查询GetDeviceStatusRequest
     */
    ApiClient.prototype.getDeviceStatus = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetDeviceStatus", request, {
                            apiDesc: "2.6.3设备状态查询",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.6.4根据通道获取当前车辆GetCarInfoByNodeIdRequest
     */
    ApiClient.prototype.getCarInfoByNodeId = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetCarInfoByNodeId", request, {
                            apiDesc: "2.6.4根据通道获取当前车辆",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.6.6获取车辆图片信息
     */
    ApiClient.prototype.getParkingImg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetParkingImg", request, {
                            apiDesc: "2.6.6获取车辆图片信息",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.6.9查询车辆当前所在车场
     */
    ApiClient.prototype.getCarLocatePartId = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("config/platform/GetCarLocatePartId", request, { apiDesc: "2.6.9查询车辆当前所在车场" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.6.10区域剩余车位查询
     */
    ApiClient.prototype.getAreaFreeSpaceNum = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetAreaFreeSpaceNum", request, {
                            apiDesc: "2.6.10区域剩余车位查询",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.6.16根据通道获取当前车辆(地感车辆信息)
     */
    ApiClient.prototype.getNodeCarInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/wec/GetNodeCarInfo", request, {
                            apiDesc: "2.6.16根据通道获取当前车辆(地感车辆信息)",
                        })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.7.1空闲车位修改
     */
    ApiClient.prototype.modifyFreeSpace = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/ModifyFreeSpace", request, {
                            apiDesc: "2.7.1空闲车位修改",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.2道闸控制
     */
    ApiClient.prototype.gateControl = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/GateControl", request, {
                            apiDesc: "2.7.2道闸控制",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.3显示屏推送
     */
    ApiClient.prototype.pushScreenMsg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/PushScreenMsg", request, {
                            apiDesc: "2.7.3显示屏推送",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.4车牌修改
     */
    ApiClient.prototype.modifyCarNo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/ModifyCarNo", request, {
                            apiDesc: "2.7.4车牌修改",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.5远程开闸
     */
    ApiClient.prototype.remoteOpen = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/RemoteOpen", request, {
                            apiDesc: "2.7.5远程开闸",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.6修改场内车数据
     */
    ApiClient.prototype.modifyCarInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/ModifyCarInfo", request, {
                            apiDesc: "2.7.6修改场内车数据",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.11显示屏推送扩展接口（LED全彩屏)
     */
    ApiClient.prototype.pushLedScreenMsg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/PushLedScreenMsg", request, {
                            apiDesc: "2.7.11显示屏推送扩展接口（LED全彩屏)",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.12显示屏推送扩展接口（LCD）
     */
    ApiClient.prototype.pushLcdScreenMsg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/PushLcdScreenMsg", request, {
                            apiDesc: "2.7.12显示屏推送扩展接口（LCD）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.13显示屏推送扩展接口（LED单红屏）
     */
    ApiClient.prototype.pushSrsScreenMsg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/PushSrsScreenMsg", request, {
                            apiDesc: "2.7.13显示屏推送扩展接口（LED单红屏）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.14显示屏推送扩展接口（LED单红屏-剩余车位）
     */
    ApiClient.prototype.pushSrsScreenLotMsg = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/control/PushSrsScreenLotMsg", request, {
                            apiDesc: "2.7.14显示屏推送扩展接口（LED单红屏-剩余车位）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.15新增虚拟进出场
     */
    ApiClient.prototype.addVirtualTraffic = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/traffic/AddVirtualTraffic", request, {
                            apiDesc: "2.7.15新增虚拟进出场",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.7.16进出场重新抓拍接口
     */
    ApiClient.prototype.recapture = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/traffic/Recapture", request, {
                            apiDesc: "2.7.16进出场重新抓拍接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.8.1新增黑名单车牌信息
     */
    ApiClient.prototype.addCarBlackInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/blacklist/AddCarBlackInfo", request, {
                            apiDesc: "2.8.1新增黑名单车牌信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.8.2修改黑名单车牌信息AddCarBlackInfoRequest
     */
    ApiClient.prototype.modifyCarBlackInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/blacklist/ModifyCarBlackInfo", request, {
                            apiDesc: "2.8.2修改黑名单车牌信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.8.3删除黑名单车牌信息
     */
    ApiClient.prototype.delCarBlackInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/blacklist/DelCarBlackInfo", request, {
                            apiDesc: "2.8.3删除黑名单车牌信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.8.4查询黑名单列表
     */
    ApiClient.prototype.queryCarBlackInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/blacklist/QueryCarBlackInfo", request, { apiDesc: "2.8.4查询黑名单列表" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.9.1锁车接口
     */
    ApiClient.prototype.lockCarplate = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/card/LockCarplate", request, {
                            apiDesc: "2.9.1锁车接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.9.2解锁接口
     */
    ApiClient.prototype.unlockCarplate = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/card/UnlockCarplate", request, {
                            apiDesc: "2.9.2解锁接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getFloorList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetFloorList", request, {
                            apiDesc: "2.10.1楼层列表查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getAreaList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetAreaList", request, {
                            apiDesc: "2.10.2区域列表查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getCarLocInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetCarLocInfo", request, {
                            apiDesc: "2.10.3车辆停放位置查询接口(精准)",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getSpaceInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetSpaceInfo", request, {
                            apiDesc: "2.10.5楼层车位状态查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getCarRoute = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetCarRoute", request, {
                            apiDesc: "2.10.6车辆线路URL接口(图片)",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getFindCarFreeSpaceNum = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetFreeSpaceNum", request, {
                            apiDesc: "2.10.7空余车位数查询接口（找车）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.GetCarImageUrl = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetCarImageUrl", request, {
                            apiDesc: "2.10.8车位图片URL接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getNodeDeviceStatus = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/getNodeDeviceStatus", request, {
                            apiDesc: "2.10.11 节点设备状态查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getSingleNodeDeviceStatus = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/getSingleNodeDeviceStatus", request, { apiDesc: "2.10.12 单个节点设备状态查询接口" })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.updateLightScheme = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/updateLightScheme", request, {
                            apiDesc: "2.10.13 根据车位编号修改车位灯方案",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.updateParkType = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/updateParkType", request, {
                            apiDesc: "2.10.14 根据车位编号修改车位类型",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.updateParkStatusBatch = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/updateParkStatusBatch", request, {
                            apiDesc: "2.10.15 根据车位地址批量修改车位状态（未开发）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getParkListByPlateNo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/getParkListByPlateNo", request, {
                            apiDesc: "2.10.16 根据车牌查车位（模糊）",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.parkCameraSnapPicture = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/parkCameraSnapPicture", request, {
                            apiDesc: "2.10.17 车位相机抓拍接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.listInOutCarInfo = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/listInOutCarInfo", request, {
                            apiDesc: "2.10.18 历史进出车明细查询",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 统一找车接口
     */
    ApiClient.prototype.getPlateRecognitionRecord = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/getPlateRecognitionRecord", request, { apiDesc: "2.10.22 车牌识别记录查询" })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.10.9车位图片URL接口
     */
    ApiClient.prototype.getCarImageUrl = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("findCar/GetCarImageUrl", request, {
                            apiDesc: "2.10.9车位图片URL接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.1预下单接口
     */
    ApiClient.prototype.prepay = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("ttp/order/Prepay", request, {
                            apiDesc: "2.12.1预下单接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.2根据ttpOrderNo订单号查询订单状态
     */
    ApiClient.prototype.queryPrepayOrder = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("ttp/order/QueryPrepayOrder", request, {
                            apiDesc: "2.12.2根据ttpOrderNo订单号查询订单状态",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.3充值预下单接口
     */
    ApiClient.prototype.rechargePrepay = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("stcttp/recharge/prepay", request, {
                            apiDesc: "2.12.3充值预下单接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.4查询充值订单状态
     */
    ApiClient.prototype.queryRechargePrepayOrder = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("stcttp/recharge/query", request, {
                            apiDesc: "2.12.4查询充值订单状态",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.5第三方应用获取临时访问令牌
     */
    ApiClient.prototype.getTicket = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("ttp-ticket/service/getTicket", request, {
                            apiDesc: "2.12.5第三方应用获取临时访问令牌",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.6第三方发放优惠券
     */
    ApiClient.prototype.grantCoupon = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("cn.keytop.stc.cp.external.coupon.GrantCoupon/1.0", request, { apiDesc: "2.12.6第三方发放优惠券" })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.7第三方查询优惠券
     */
    ApiClient.prototype.queryCoupon = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("cn.keytop.stc.cp.external.coupon.QueryCoupon/1.0", request, { apiDesc: "2.12.7第三方查询优惠券" })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.8临停订单退款接口
     */
    ApiClient.prototype.orderRefund = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("stcttp/order/refund", request, {
                            apiDesc: "2.12.8临停订单退款接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 科拓统一对外接口协议（速停车相关接口仅针对国内）
     * 2.12.9临停订单退款查询接口
     */
    ApiClient.prototype.orderRefundQuery = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("stcttp/order/refund/query", request, {
                            apiDesc: "2.12.9临停订单退款查询接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getCardInfoByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetCardInfoByUser", request, {
                            apiDesc: "2.13.1根据车牌获取内部车信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getRechargeRuleByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetRechargeRuleByUser", request, {
                            apiDesc: "2.13.2根据车位获取充值规则",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getRechargePreDataByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetRechargePreDataByUser", request, {
                            apiDesc: "2.13.3预充值接口",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.rechargeByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/RechargeByUser", request, {
                            apiDesc: "2.13.4内部车充值",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getCardInfoFromCardNoByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetCardInfoFromCardNoByUser", request, {
                            apiDesc: "2.13.5根据卡号获取内部车信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.addByUser = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/AddByUser", request, {
                            apiDesc: "2.13.6内部车申请",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getCardConfigList = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetCardConfigList", request, {
                            apiDesc: "2.13.7获取内部车配置信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    ApiClient.prototype.getPreOrderCache = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("api/carCard/GetPreOrderCache", request, {
                            apiDesc: "2.13.8获取内部车预充值缓存信息",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.14.9获取当前用户信息
     */
    ApiClient.prototype.queryCurrentUser = function (token, request) {
        return __awaiter(this, void 0, void 0, function () {
            var config, res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        config = {
                            headers: {
                                "kt-token": token,
                                Cookie: "mer=" + token,
                                "content-type": "application/json;charset=UTF-8",
                                "access-control-allow-credentials": true,
                                "access-control-allow-headers": "Origin,Content-Type,Accept,token,X-Requested-With,cookie,lotId",
                            },
                            apiDesc: "2.14.9获取当前用户信息",
                        };
                        return [4 /*yield*/, this.post("mercoupon/unity/queryCurrentUser", request, config)];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.14.12 根据抵扣劵号查询抵扣明细
     */
    ApiClient.prototype.queryRecordById = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("kosCouponConsole/service/open/queryRecordById", request, { apiDesc: "2.14.12 根据抵扣劵号查询抵扣明细" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    //SAAS接口
    ApiClient.prototype.queryAllLotCoupon4Unity = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("mercoupon/unity/queryAllLotCoupon4Unity", request, { apiDesc: "2.14.13查看车场所有抵扣券模板" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
     * 2.15.10获取用户信息
     */
    ApiClient.prototype.getMyBaseInfo = function (request, token) {
        return __awaiter(this, void 0, void 0, function () {
            var config, res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        config = {
                            headers: { "kt-token": token },
                            apiDesc: "2.15.10获取用户信息",
                        };
                        return [4 /*yield*/, this.post("unity/service/open/user/getMyBaseInfo", request, config)];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.15.4停车场与角色关系查询
     */
    ApiClient.prototype.findLotRoles = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("unity/service/open/role/findLotRoles", request, { apiDesc: "2.15.4停车场与角色关系查询" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.15.8停车场与用户关系查询
     */
    ApiClient.prototype.findListByLotIdPage = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("unity/service/open/user/findListByLotIdPage", request, { apiDesc: "2.15.8停车场与用户关系查询" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data];
                }
            });
        });
    };
    /**
     * 2.15.12 外部系统日志保存
     */
    ApiClient.prototype.saveLog = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("unity/log/saveLog", request, {
                            apiDesc: "2.15.12 外部系统日志保存",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 第三方充值抵扣券
     */
    ApiClient.prototype.recharge3rdByUnity = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("mercoupon/unity/recharge3rdByUnity", request, {
                            apiDesc: "第三方充值抵扣券",
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 查看车场商户信息
     */
    ApiClient.prototype.queryLotMer4Unity = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post("mercoupon/unity/queryLotMer4Unity", request, { apiDesc: "查看车场商户信息" })];
                    case 1:
                        res = _a.sent();
                        if (!Dto_1.ApiResponse.isSuccess(res))
                            return [2 /*return*/, Promise.reject(res.resMsg || res.resCode)];
                        return [2 /*return*/, res.data ? JSON.parse(res.data) : null];
                }
            });
        });
    };
    /**
       * 2.5.4 内部车修改有效期
       */
    ApiClient.prototype.modifyValidTime = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/card/ModifyValidTime', request, { apiDesc: '2.5.4 内部车修改有效期' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
    * 2.11.1 预约车退款状态回调
    */
    ApiClient.prototype.parkingBookingRefundCallback = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/booking/parkingBookingRefundCallback', request, { apiDesc: '2.11.1 预约车退款状态回调' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 2.13.2 重新统计汇总报表
     */
    ApiClient.prototype.reStatistics = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/report/reStatistics', request, { apiDesc: '2.13.2 重新统计汇总报表' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * SAAS统一接口协议-2.16.1系统公告推送
     */
    ApiClient.prototype.addSysNotice = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var config;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        config = { apiDesc: '2.16.1系统公告推送', headers: { KT_LOT_ID: request.parkId } };
                        return [4 /*yield*/, this.post('saas/saas-inner-api/notice/addSysNotice', request, config)];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * SAAS统一接口协议-停车场云助手app模板消息发送
     */
    ApiClient.prototype.messageSend = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            var config;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        config = { apiDesc: '停车场云助手app模板消息发送', headers: { KT_LOT_ID: request.parkId } };
                        return [4 /*yield*/, this.post('saasConsole/kos_platform_api/service/open/message/send', request, config)];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * MQ透传接口
     */
    ApiClient.prototype.msgToLocal = function (request, config) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('non_standard/MsgToLocal', request, config)];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    /**
     * 3.1
     * 通道接口
     * 这是一个大类接口，子接口见ChannelApi
     */
    ApiClient.prototype.channelSend = function (request) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.post('nkcInnerApi/normal/ChannelSend', request, { apiDesc: '3.1 通道接口' })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    return ApiClient;
}());
exports.ApiClient = ApiClient;
//# sourceMappingURL=ApiClient.js.map