var WEBBase = require("../../web.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class PaymentAPI extends WEBBase {
    constructor() {
        super();
        this.execlient = system.getObject("util.execClient");
    }

    /**
     * 接口跳转-POST请求
     * actionProcess  执行的流程
     * actionType     执行的类型
     * actionBody     执行的参数
     */
    async springBoard(pobj, qobj, req) {
        if (!pobj.actionProcess) {
            return system.getResult(null, "actionProcess参数不能为空");
        }
        if (!pobj.actionType) {
            return system.getResult(null, "actionType参数不能为空");
        }
        var result = await this.opActionProcess(pobj, pobj.actionType, pobj.actionBody, req);
        return result;
    }
    async opActionProcess(pobj, action_type, action_body, req) {
        var opResult = null;
        var url = "";
        switch (action_type) {
            // sy
            case "needinfo2fq"://pc端订单支付二维码生成
                url = settings.centerOrderUrl() + "action/zcbusinesschanceApi/springBoard";
                break;
            // case "flowinfo"://pc端订单支付二维码生成
            //     opResult = await this.needinfoSve.flowinfo(needinfo);
            //     break;
            default:
                opResult = system.getResult(null, "action_type参数错误");
                break;
        }
        // var url = settings.centerAppUrl() + "action/opProduct/springBoard";
        return await this.restPostUrl(pobj, url);
        // return opResult;
    }

}
module.exports = PaymentAPI;