Commit 24e6347b by 王昆

gsb

parent 1bee345e
......@@ -6,6 +6,7 @@ class ActionAPI extends APIBase {
constructor() {
super();
this.merchantSve = system.getObject("service.merchant.merchantSve");
this.merchantapiSve = system.getObject("service.merchant.merchantapiSve");
this.merchanttradeSve = system.getObject("service.merchant.merchanttradeSve");
this.merchantaccountSve = system.getObject("service.merchant.merchantaccountSve");
}
......@@ -93,6 +94,11 @@ class ActionAPI extends APIBase {
opResult = await this.merchantaccountSve.addordelavailable(action_body);
break;
// api信息查询
case "apiInfoById" :
opResult = await this.merchantapiSve.infoById(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -69,7 +69,7 @@ class MerchantService extends ServiceBase {
params.id = id;
rtn = await this.dao.create(params);
var secret = (await this.getUidInfo(32)).toLowerCase();
this.merchantapiSve.create({merchant_id: id, name: merchant.name, secret: secret, is_enabled: true});
this.merchantapiSve.create({merchant_id: id, name: rtn.name, secret: secret, is_enabled: true});
}
return system.getResultSuccess(rtn);
} catch (e) {
......
const ServiceBase = require("../../sve.base");
const system = require("../../../system");
class merchantapiService extends ServiceBase {
constructor() {
super("merchant", ServiceBase.getDaoName(merchantapiService));
}
async infoById(params) {
let info = await this.dao.getById(params.id);
return system.getResultSuccess(info);
}
}
module.exports = merchantapiService;
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