Commit bc0dad7caddc97ad0fe57face8af4f45a9ceb232

Authored by Nattapon Wongpaet
1 parent c1bcb964
Exists in master and in 1 other branch develop

update d01

Showing 3 changed files with 108 additions and 11 deletions   Show diff stats
app.js
... ... @@ -369,6 +369,6 @@ app.delete('/api/v1/gender', require('./d01').deleteGender);
369 369 app.post('/auth/v3.1/oauth/token', require('./admd').oauthToken);
370 370 app.post('/auth/v3.1/logout', require('./admd').logout);
371 371  
372   -
  372 +app.post('/v1/MVP/enq/getMobileOfferInventory/', require('./true').getMobileOfferInventory);
373 373  
374 374 app.listen(port, () => console.log('app listening on port ' + port + '!'))
375 375 \ No newline at end of file
... ...
d01.js
... ... @@ -89,7 +89,7 @@ module.exports.deleteCustomer = async (req, res) => {
89 89 "resultDescription": "Success"
90 90 }
91 91  
92   - // res.send(response)
  92 + res.send(response)
93 93 }
94 94  
95 95 module.exports.getMemberLink = async (req, res) => {
... ... @@ -149,8 +149,8 @@ module.exports.postMemberLink = async (req, res) => {
149 149 console.log('body', req.body);
150 150  
151 151 let response = {
152   - "resultCode": "20000",
153   - "resultDescription": "Success"
  152 + "resultCode": "50000",
  153 + "resultDescription": "System error"
154 154 }
155 155  
156 156 res.send(response)
... ... @@ -197,7 +197,7 @@ module.exports.getAddress = async (req, res) => {
197 197  
198 198 let data = []
199 199  
200   - for (let i = 0; i < 30; i++) {
  200 + for (let i = 0; i < 2; i++) {
201 201 data.push({
202 202 "enterpriseId": "$enterpriseId",
203 203 "customerId": "$customerId",
... ... @@ -232,11 +232,16 @@ module.exports.getAddress = async (req, res) =&gt; {
232 232 resultData = resultData.slice(0, +req.query.limit)
233 233 }
234 234  
  235 + // let response = {
  236 + // "resultCode": "20000",
  237 + // "resultDescription": "Success",
  238 + // "resultData": resultData,
  239 + // "rowCount": '' + data.length
  240 + // }
  241 +
235 242 let response = {
236   - "resultCode": "20000",
237   - "resultDescription": "Success",
238   - "resultData": resultData,
239   - "rowCount": '' + data.length
  243 + "resultCode": "40401",
  244 + "resultDescription": "Data not found"
240 245 }
241 246  
242 247 res.send(response)
... ... @@ -251,8 +256,8 @@ module.exports.postAddress = async (req, res) =&gt; {
251 256 console.log('body', req.body);
252 257  
253 258 let response = {
254   - "resultCode": "20000",
255   - "resultDescription": "Success"
  259 + "resultCode": "50000",
  260 + "resultDescription": "System error"
256 261 }
257 262  
258 263 res.send(response)
... ...
true.js 0 โ†’ 100644
... ... @@ -0,0 +1,92 @@
  1 +module.exports.getMobileOfferInventory = async (req, res) => {
  2 + console.log('===== GET mobileOfferInventory =====')
  3 + console.log('url', req.originalUrl);
  4 + console.log('headers', req.headers);
  5 + console.log('query', req.query);
  6 + console.log('params', req.params);
  7 +
  8 + let response = {
  9 + "code": 200,
  10 + "desc": "Success",
  11 + "sizes": 1,
  12 + "offerSummaryList": [
  13 + {
  14 + "size": 1,
  15 + "offerSummaryInfo": [
  16 + {
  17 + "bundleInfo": {
  18 + "voice": [
  19 + {
  20 + "quota": "100",
  21 + "quotaUnit": "Minutes",
  22 + "eventType": "FIX,OF,ON",
  23 + "sharingFlag": "N",
  24 + "rollOverTime": "0",
  25 + "voiceGroup": "ALLNET",
  26 + "priceingItemId": "102163"
  27 + }
  28 + ],
  29 + "data": [
  30 + {
  31 + "quota": "0",
  32 + "quotaUnit": null,
  33 + "dataGroup": "UNLIMIT",
  34 + "fupSpeed": null,
  35 + "fupSpeedUnit": null,
  36 + "maxSpeed": null,
  37 + "maxSpeedUnit": null,
  38 + "fupSpeedConfig": null,
  39 + "fupSpeedConfigUnit": null,
  40 + "lifeTime": "36500",
  41 + "lifeTimeType": "EOD",
  42 + "recurringTime": "1",
  43 + "rollOverTime": "0",
  44 + "additional": "N",
  45 + "communicate": null,
  46 + "serviceFlag": "0000000",
  47 + "subKey": "WiFi"
  48 + },
  49 + {
  50 + "quota": "2",
  51 + "quotaUnit": "GB",
  52 + "dataGroup": "UNLIMIT",
  53 + "fupSpeed": "1024",
  54 + "fupSpeedUnit": "Kbps",
  55 + "maxSpeed": null,
  56 + "maxSpeedUnit": null,
  57 + "fupSpeedConfig": null,
  58 + "fupSpeedConfigUnit": null,
  59 + "lifeTime": "36500",
  60 + "lifeTimeType": "EOD",
  61 + "recurringTime": "1",
  62 + "rollOverTime": "0",
  63 + "additional": "N",
  64 + "communicate": null,
  65 + "serviceFlag": "1300000",
  66 + "subKey": "Internet Vol"
  67 + }
  68 + ],
  69 + "other": [
  70 + {
  71 + "key": "SMS",
  72 + "quota": "200",
  73 + "sharingFlag": "N",
  74 + "rollOverTime": "0"
  75 + },
  76 + {
  77 + "key": "MMS",
  78 + "quota": "100",
  79 + "sharingFlag": "N",
  80 + "rollOverTime": "0"
  81 + }
  82 + ]
  83 + }
  84 + }
  85 + ]
  86 + }
  87 + ]
  88 + }
  89 +
  90 +
  91 + res.status(200).send(response)
  92 +}
0 93 \ No newline at end of file
... ...