Commit ad2fa4ed15e8a8263b2e65da2ef631a6293ffa3c
1 parent
b77690fa
Exists in
master
and in
1 other branch
update summarylog and stat
Showing
3 changed files
with
8 additions
and
4 deletions
Show diff stats
ais-structure/src/modules/customer/customer.ctrl.js
... | ... | @@ -53,7 +53,7 @@ exports.customer = async function (req, res, next) { |
53 | 53 | { |
54 | 54 | stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); |
55 | 55 | var response = responseMsg.error(req,getCmd,40401); |
56 | - log.addErrorSummary(req,d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); | |
56 | + log.addErrorSummary(req,d01,method+"_"+sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
57 | 57 | } |
58 | 58 | } else if(resultObj.resultCode.startsWith("404")){ |
59 | 59 | stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | ... | ... |
ais-structure/src/modules/membercard/getMembership.ctrl.js
... | ... | @@ -77,7 +77,7 @@ exports.getMembership = async function (req, res, next) { |
77 | 77 | } else { |
78 | 78 | stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); |
79 | 79 | var response = responseMsg.error(req,getCmd,40401); |
80 | - log.addErrorSummary(req,d01,method+"_"+sendCusCmd,response.resultCode,response.developerMessage); | |
80 | + log.addErrorSummary(req,d01,method+"_"+sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
81 | 81 | } |
82 | 82 | } else if(resultObj.resultCode.startsWith("404")){ |
83 | 83 | stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | ... | ... |
ais-structure/src/modules/membercard/postMembership.ctrl.js
... | ... | @@ -108,7 +108,7 @@ exports.postMembership = async function (req, res, next){ |
108 | 108 | } else { //data not found |
109 | 109 | |
110 | 110 | stats.receiveRestResponse(d01,getMethod,sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); |
111 | - log.addSuccessSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
111 | + log.addErrorSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
112 | 112 | |
113 | 113 | //get customer |
114 | 114 | |
... | ... | @@ -116,6 +116,10 @@ exports.postMembership = async function (req, res, next){ |
116 | 116 | var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership); |
117 | 117 | } |
118 | 118 | } else if(resultObj.resultCode.startsWith("404")){ //data not found |
119 | + | |
120 | + stats.receiveRestResponse(d01,getMethod,sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
121 | + log.addErrorSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
122 | + | |
119 | 123 | //get customer |
120 | 124 | var getCustomer = await getCustomerD01(req, objDataGetCustomer); |
121 | 125 | var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership); |
... | ... | @@ -286,7 +290,7 @@ async function getCustomerHandler(req, getCustomer, getMemberCard, objDataMember |
286 | 290 | } else { |
287 | 291 | stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.RESPONSERESULT.DATA_NOT_FOUND.resultDescription); |
288 | 292 | var response = responseMsg.error(req, getCmd, 40401); |
289 | - log.addErrorSummary(req,d01, getMethod+"_"+sendCustomerCmd, response.resultCode, response.resultDescription); | |
293 | + log.addErrorSummary(req,d01, getMethod+"_"+sendCustomerCmd, constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode, constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); | |
290 | 294 | } |
291 | 295 | } else if(getCustomer.isDirect){ |
292 | 296 | stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.ERROR); | ... | ... |