Commit 24e6347b by 王昆

gsb

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