Commit 0ec6fba7ec13818fd3ec2013432a517bc8167f35
1 parent
5a93fae2
Exists in
master
and in
1 other branch
update fix bug
Showing
9 changed files
with
20 additions
and
24 deletions
Show diff stats
ais-structure/src/config/config.js
ais-structure/src/modules/customer/customer.ctrl.js
... | ... | @@ -46,18 +46,7 @@ function validator(req,api) |
46 | 46 | var list = []; |
47 | 47 | list.push([true,"queryStr","commandId","String"]); |
48 | 48 | var err = validatorHelper(req,list,api) |
49 | - | |
50 | - //oc | |
51 | - if((typeof req.query["customerId"] === 'undefined') && (typeof req.query["userType"] === 'undefined')) | |
52 | - { | |
53 | - var errDes = { | |
54 | - Param : "customerId or userType", | |
55 | - Reason : "Missing" | |
56 | - } | |
57 | - err.push(errDes); | |
58 | - | |
59 | - }else | |
60 | - { | |
49 | + | |
61 | 50 | if((typeof req.query["userType"] !== 'undefined') && (typeof req.query["userData"] === 'undefined')) |
62 | 51 | { |
63 | 52 | var errDes = { |
... | ... | @@ -67,8 +56,6 @@ function validator(req,api) |
67 | 56 | err.push(errDes); |
68 | 57 | } |
69 | 58 | |
70 | - } | |
71 | - | |
72 | 59 | if(err.length > 0) |
73 | 60 | stats.reciveRequest(req.method,api,false); |
74 | 61 | else | ... | ... |
ais-structure/src/modules/customer/customer.route.js
ais-structure/src/modules/customer/postCustomer.ctrl.js
... | ... | @@ -31,9 +31,9 @@ exports.postCustomer = async function (req, res, next){ |
31 | 31 | const result = await connection.requestJsonToD01(objectData,sendCmd,"POST"); |
32 | 32 | |
33 | 33 | if(typeof result.err === 'undefined'){ |
34 | - // console.log(result.response.body); | |
34 | + console.log(result.response.body); | |
35 | 35 | var resultObj = JSON.parse(result.response.body); |
36 | - // (req,cmd,data,result) | |
36 | + | |
37 | 37 | if(resultObj.resultCode.startsWith("40")) |
38 | 38 | { |
39 | 39 | if(resultObj.resultCode != "40401") | ... | ... |
ais-structure/src/modules/helper/connection.js
... | ... | @@ -32,7 +32,7 @@ connection.requestJsonToD01 = function (obj,cmd,myMethod) { |
32 | 32 | { |
33 | 33 | params.body = JSON.stringify(params.body); |
34 | 34 | } |
35 | - | |
35 | + | |
36 | 36 | return asyncRequest(params,cmd,cfg.service.D01.Name); |
37 | 37 | |
38 | 38 | |
... | ... | @@ -55,7 +55,7 @@ function asyncRequest (params = {},cmd,node) { |
55 | 55 | }); |
56 | 56 | } else { |
57 | 57 | // console.log("normal"); |
58 | - stats.reciveResponse(node,cmd,"Success"); | |
58 | + // stats.reciveResponse(node,cmd,"Success"); | |
59 | 59 | resolve({ |
60 | 60 | 'body' : body, |
61 | 61 | 'response' : response | ... | ... |
ais-structure/src/modules/helper/log.js
ais-structure/src/modules/helper/responseMsg.js
ais-structure/src/modules/helper/validator.js
ais-structure/src/modules/vizcard/vizCard.ctrl.js
... | ... | @@ -9,17 +9,16 @@ var log = require('../helper/log.js'); |
9 | 9 | |
10 | 10 | exports.vizcard = async function (req, res, next) { |
11 | 11 | var getCmd = "VIZCard"; |
12 | - var sendCmd = "SearchCustomer"; | |
12 | + var sendCmd = "SearchCustomer" | |
13 | 13 | |
14 | 14 | log.startlog(getCmd,req); |
15 | 15 | log.logDetail.addInput("Client",getCmd,"Request",req); |
16 | 16 | |
17 | - // (node,cmd,type,rawData,data) | |
18 | 17 | var err = validator(req,getCmd); |
19 | 18 | |
20 | 19 | if(err.length > 0) |
21 | 20 | { |
22 | - console.log(err); | |
21 | + log.log(err); | |
23 | 22 | |
24 | 23 | var response = responseMsg.error(req,getCmd,40300); |
25 | 24 | ... | ... |