Commit a1c724c5 by 王昆

gsb

parent 291c0201
......@@ -6,6 +6,8 @@ class SaasAPI extends APIBase {
this.orderSve = system.getObject("service.order.orderSve");
this.businessscopeSve = system.getObject("service.common.businessscopeSve");
this.saasbusinessSve = system.getObject("service.saas.saasbusinessSve");
this.channelSve = system.getObject("service.saas.channelSve");
this.userSve = system.getObject("service.uc.userSve");
this.restClient = system.getObject("util.restClient");
}
async openSaas(pobj, query, req) {
......@@ -16,6 +18,15 @@ class SaasAPI extends APIBase {
}
return rs;
}
async openSaasChannel(pobj, query, req) {
let rs = await this.channelSve.save(pobj);
if (rs.status === 0 && rs.data && rs.data.id) {
// 更新用户
let rs21 = await this.userSve.updatePlatformUserChannelIdBySaasId({saas_id: pobj.saas_id, channel_id: rs.data.id});
console.log(rs21);
}
return rs;
}
exam() {
return "";
......
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
const settings = require("../../../../config/settings")
class ChannelService extends ServiceBase {
constructor() {
super();
}
async dics(params) {
var rs = await this.callms("merchant", "channelDics", params || {});
return rs;
}
async page(params) {
var rs = await this.callms("merchant", "channelPage", params);
return rs;
}
async save(params) {
var rs = await this.callms("merchant", "channelSave", params);
return rs;
}
async info(params) {
var rs = await this.callms("merchant", "channelInfo", params);
return rs;
}
async mapByIds(params) {
var rs = await this.callms("merchant", "channelMapByIds", params);
return rs;
}
}
module.exports = ChannelService;
\ No newline at end of file
......@@ -13,5 +13,13 @@ class SaasService extends ServiceBase {
}
}
async openSaasBusiness(params){
try {
return await this.callms("uc", "openSaasBusiness", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = SaasService;
\ No newline at end of file
......@@ -143,5 +143,14 @@ class UserService extends ServiceBase {
}
}
async updatePlatformUserChannelIdBySaasId(params) {
try {
return await this.callms("uc", "updatePlatformUserChannelIdBySaasId", params);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error.stack}`);
}
}
}
module.exports = UserService;
\ No newline at end of file
......@@ -178,7 +178,7 @@ class System {
// common: "http://127.0.0.1:3102" + path,
// 商户服务
merchant: domain + ":3101" + path,
merchant: domain2 + ":3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
......@@ -190,7 +190,7 @@ class System {
// invoice: domain + ":3105" + path,
// 用户中心
uc: domain + ":3106" + path ,
uc: domain2 + ":3106" + path ,
// uc: "http://127.0.0.1:3106" + path,
}
} else {
......
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