diff --git a/ais-structure/src/config/config.js b/ais-structure/src/config/config.js index 5f9c3fa..cb1c862 100644 --- a/ais-structure/src/config/config.js +++ b/ais-structure/src/config/config.js @@ -37,7 +37,7 @@ var config = { statTime : 2, detailTime : 15, summaryTime : 15, - statInterval : 1, + statInterval : 60, appLogPath : './logTest/', summaryPath : './logTest/', statPath : './logTest/', diff --git a/ais-structure/src/modules/customer/customer.ctrl.js b/ais-structure/src/modules/customer/customer.ctrl.js index c0a9e8f..ae5d5ac 100644 --- a/ais-structure/src/modules/customer/customer.ctrl.js +++ b/ais-structure/src/modules/customer/customer.ctrl.js @@ -46,18 +46,7 @@ function validator(req,api) var list = []; list.push([true,"queryStr","commandId","String"]); var err = validatorHelper(req,list,api) - - //oc - if((typeof req.query["customerId"] === 'undefined') && (typeof req.query["userType"] === 'undefined')) - { - var errDes = { - Param : "customerId or userType", - Reason : "Missing" - } - err.push(errDes); - - }else - { + if((typeof req.query["userType"] !== 'undefined') && (typeof req.query["userData"] === 'undefined')) { var errDes = { @@ -67,8 +56,6 @@ function validator(req,api) err.push(errDes); } - } - if(err.length > 0) stats.reciveRequest(req.method,api,false); else diff --git a/ais-structure/src/modules/customer/customer.route.js b/ais-structure/src/modules/customer/customer.route.js index 0624229..28ef46c 100644 --- a/ais-structure/src/modules/customer/customer.route.js +++ b/ais-structure/src/modules/customer/customer.route.js @@ -6,7 +6,7 @@ module.exports = function (app) { customerCtrl.customer ); - app.post('/cmf/v2/customer.json', + app.post('/cmf/v2/customer/customerId.json', postCustomerCtrl.postCustomer ); }; diff --git a/ais-structure/src/modules/customer/postCustomer.ctrl.js b/ais-structure/src/modules/customer/postCustomer.ctrl.js index ea1f476..c7b2219 100644 --- a/ais-structure/src/modules/customer/postCustomer.ctrl.js +++ b/ais-structure/src/modules/customer/postCustomer.ctrl.js @@ -31,9 +31,9 @@ exports.postCustomer = async function (req, res, next){ const result = await connection.requestJsonToD01(objectData,sendCmd,"POST"); if(typeof result.err === 'undefined'){ - // console.log(result.response.body); + console.log(result.response.body); var resultObj = JSON.parse(result.response.body); - // (req,cmd,data,result) + if(resultObj.resultCode.startsWith("40")) { if(resultObj.resultCode != "40401") diff --git a/ais-structure/src/modules/helper/connection.js b/ais-structure/src/modules/helper/connection.js index af44625..cd3484d 100644 --- a/ais-structure/src/modules/helper/connection.js +++ b/ais-structure/src/modules/helper/connection.js @@ -32,7 +32,7 @@ connection.requestJsonToD01 = function (obj,cmd,myMethod) { { params.body = JSON.stringify(params.body); } - + return asyncRequest(params,cmd,cfg.service.D01.Name); @@ -55,7 +55,7 @@ function asyncRequest (params = {},cmd,node) { }); } else { // console.log("normal"); - stats.reciveResponse(node,cmd,"Success"); + // stats.reciveResponse(node,cmd,"Success"); resolve({ 'body' : body, 'response' : response diff --git a/ais-structure/src/modules/helper/log.js b/ais-structure/src/modules/helper/log.js index 5e7dc75..bc65694 100644 --- a/ais-structure/src/modules/helper/log.js +++ b/ais-structure/src/modules/helper/log.js @@ -39,6 +39,8 @@ logger.log = function (msg,type) default: logg.debug(msg); } + + console.log(msg); } logger.startlog = function (cmdData,rawData) diff --git a/ais-structure/src/modules/helper/responseMsg.js b/ais-structure/src/modules/helper/responseMsg.js index 36e8663..30cb709 100644 --- a/ais-structure/src/modules/helper/responseMsg.js +++ b/ais-structure/src/modules/helper/responseMsg.js @@ -12,6 +12,9 @@ responseMsg.error = function (req,cmd,code){ case 40300: devMsg = "Missing or invalid parameter"; break; + default: + code = 50000; + devMsg = "System error"; } var response = { diff --git a/ais-structure/src/modules/helper/validator.js b/ais-structure/src/modules/helper/validator.js index f992445..0142e8b 100644 --- a/ais-structure/src/modules/helper/validator.js +++ b/ais-structure/src/modules/helper/validator.js @@ -63,7 +63,12 @@ function getData(req,row) if(arrayStr.length > 1) { for(var i=1;i 0) { - console.log(err); + log.log(err); var response = responseMsg.error(req,getCmd,40300); -- libgit2 0.21.2