Commit bb268fab by 王栋源

wdy

parent 206e07b0
......@@ -5,6 +5,7 @@ const uuidv4 = require('uuid/v4');
const md5 = require("MD5");
class APIBase {
constructor() {
this.restClient = system.getObject("util.restClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.logCtl = system.getObject("service.common.oplogSve");
this.toolSve = system.getObject("service.trademark.toolSve");
......@@ -106,5 +107,14 @@ class APIBase {
}
//-----------------------新的模式------------------结束
async restPostUrl(pobj, url) {
var rtn = await this.restClient.execPost(pobj, url);
if (!rtn || !rtn.stdout) {
return system.getResult(null, "restPost data is empty");
}
var result = JSON.parse(rtn.stdout);
return result;
}
}
module.exports = APIBase;
......@@ -5,8 +5,6 @@ class PaymentAPI extends APIBase {
constructor() {
super();
this.execlient = system.getObject("util.execClient");
this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.centerAppUrl = settings.centerAppUrl();
}
/**
......@@ -30,26 +28,20 @@ class PaymentAPI extends APIBase {
var url = "";
switch (action_type) {
// sy
case "getQrCode"://pc端订单支付二维码生成
url = this.centerAppUrl + "payment/paymentApi/getQrCode";
break;
case "queryOrder"://通联支付查询
url = this.centerAppUrl + "payment/paymentApi/queryOrder";
break;
case "receiveCallBackNotify"://通联支付查询
url = this.centerAppUrl + "payment/paymentApi/receiveCallBackNotify";
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;
}
if (url) {
opResult = system.getResultSuccess(null, "action_type参数错误");
}
var opResultstr = await this.execlient.execPost(pobj, url);
opResult = JSON.parse(opResultstr.stdout)
return opResult;
// var url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url);
// return opResult;
}
}
module.exports = PaymentAPI;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment