Commit d8157718 by 宋毅

tj

parent 1a62a92f
...@@ -25,14 +25,11 @@ class ProductAPI extends APIBase { ...@@ -25,14 +25,11 @@ class ProductAPI extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "getCAProductListByTypeOneCode"://获取产品列表(根据产品一类编码获取) ---应用中心 case "getProductList"://通过产品类别编码路径获取产品列表
opResult = await this.utilsProductSve.findByTypeOneCode(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductList(pobj, pobj.actionBody);
break; break;
case "getCAProductListByTypeCode"://获取产品列表(根据父类产品编码获取) ---应用中心 case "getProductDetail"://根据渠道产品编码获取产品详情
opResult = await this.utilsProductSve.findByTypeCode(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody);
break;
case "getCAProductDetail"://根据渠道产品码获取产品详情 ---应用中心
opResult = await this.utilsProductSve.getProductDetailByCode(pobj, pobj.actionBody);
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
...@@ -8,6 +8,7 @@ class UtilsOrderService extends AppServiceBase { ...@@ -8,6 +8,7 @@ class UtilsOrderService extends AppServiceBase {
this.centerOrderUrl = settings.centerOrderUrl(); this.centerOrderUrl = settings.centerOrderUrl();
}; };
async addOrder(pobj, req) { async addOrder(pobj, req) {
var url = this.centerOrderUrl + "action/order/springBoard"; var url = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, url); var result = await this.restPostUrl(pobj, url);
return result; return result;
......
...@@ -8,33 +8,27 @@ class UtilsProductSve extends AppServiceBase { ...@@ -8,33 +8,27 @@ class UtilsProductSve extends AppServiceBase {
} }
//--------------------------------应用中心获取产品信息-start----------------------------------------------------- //--------------------------------应用中心获取产品信息-start-----------------------------------------------------
/** /**
* 根据产品类型码获取产品列表 * 通过产品类别编码路径获取产品列表
* @param {*} actionBody * @param {*} pobj
*/ * @param {*} actionBody pathCode 为类别编码路径,一级类下产品列表 sbfu,二级类下产品列表sbfu/sbzc
async findByTypeCode(pobj, actionBody) {
if (!actionBody.typeCode) {
return system.getResult(null, "actionBody.typeCode can not be empty");
}
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url);
}
/**
* 根据产品类型码获取产品列表
* @param {*} actionBody
*/ */
async findByTypeOneCode(pobj, actionBody) { async getProductList(pobj, actionBody) {
if (!actionBody.typeOneCode) { if (!actionBody.pathCode) {
return system.getResult(null, "actionBody.typeOneCode can not be empty"); return system.getResult(null, "actionBody.pathCode can not be empty");
} }
pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/";
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
} }
/** /**
* 获取产品详情 * 获取产品详情
* @param {*} obj * @param {*} pobj
* @param {*} actionBody channelItemCode 渠道产品编码
*/ */
async getProductDetailByCode(pobj, actionBody) { async getProductDetail(pobj, actionBody) {
if (!actionBody.channelItemCode) { if (!actionBody.channelItemCode) {
return system.getResult(null, "actionBody.channelItemCode can not be empty"); return system.getResult(null, "actionBody.channelItemCode can not be empty");
} }
...@@ -46,3 +40,4 @@ class UtilsProductSve extends AppServiceBase { ...@@ -46,3 +40,4 @@ class UtilsProductSve extends AppServiceBase {
} }
module.exports = UtilsProductSve; module.exports = UtilsProductSve;
var settings={ var settings = {
redis:{ redis: {
host: "43.247.184.32", host: "43.247.184.32",
port: 8967, port: 8967,
password: "Gongsibao2018", password: "Gongsibao2018",
db:8, db: 8,
}, },
database:{ database: {
dbname : "igirl_api", dbname: "igirl_api",
user: "write", user: "root",
password: "write", password: "root",
config: { config: {
host: '43.247.184.35', host: '121.36.3.35',
port: 8899, port: 3306,
dialect: 'mysql', dialect: 'mysql',
operatorsAliases: false, operatorsAliases: false,
pool: { pool: {
max: 5, max: 5,
min: 0, min: 0,
acquire: 90000000, acquire: 90000000,
idle: 1000000 idle: 1000000
}, },
debug:false, debug: false,
dialectOptions:{ dialectOptions: {
requestTimeout: 999999, requestTimeout: 999999,
// instanceName:'DEV' // instanceName:'DEV'
} //设置MSSQL超时时间 } //设置MSSQL超时时间
} }
}, },
reqEsDevUrl:"http://192.168.4.249:9200/", reqEsDevUrl: "http://192.168.4.249:9200/",
reqHomePageDevUrl:"http://zcchannel.apps.com:4003/", reqHomePageDevUrl: "http://zcchannel.apps.com:4003/",
reqAuthUrl:"http://sj.app.com:4002/auth" reqAuthUrl: "http://sj.app.com:4002/auth"
}; };
module.exports = settings; module.exports = settings;
...@@ -39,7 +39,7 @@ module.exports = function (app) { ...@@ -39,7 +39,7 @@ module.exports = function (app) {
req.body.appInfo = result.data; req.body.appInfo = result.data;
req.body.actionProcess = result.data.app_code; req.body.actionProcess = result.data.app_code;
var lst = [ var lst = [
"subTmOrder", "getTmOrderList", "addOrder", "getTmOrderList",
"getTmOrderInfo", "getTmApplyInfo", "getTmOrderInfo", "getTmApplyInfo",
"getTmNclList", "getNeedInfo", "getTmNclList", "getNeedInfo",
"tmConfirm", "updateTmInfo", "tmConfirm", "updateTmInfo",
......
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