Commit ea230db887504b6ba041672153d10d2acfbcd06c
1 parent
0f8247b9
Exists in
develop
update mockup
Showing
8 changed files
with
262 additions
and
11 deletions
Show diff stats
app.js
| ... | ... | @@ -442,7 +442,10 @@ app.get('/v1/product/loyaltyProgramProdSpec/pointDetail.json', require('./point' |
| 442 | 442 | |
| 443 | 443 | app.post('/sendSMS', require('./sms').sendSMS); |
| 444 | 444 | |
| 445 | +app.post('/api/v1/cst/wallets/checkWallet', require('./bot_gateway').checkWallet); | |
| 445 | 446 | |
| 447 | +app.get('/api/v2/Account/:accountId/Destinations', require('./magellan').getAccountDestination); | |
| 448 | +app.get('/api/v2/Account/:accountId/Things', require('./magellan').getAccountThings); | |
| 446 | 449 | |
| 447 | 450 | app.get('/api/random/leader', function (req, res) { |
| 448 | 451 | const months = ["เกมส์", "โน๊ต setup", "โน๊ต วัศรุต", "แบงค์", "มอส", "ปิ๊ค", "เต้นพอไม่ต้องตื่น", "เปา", "นัท", "kik", "new", "ann","na", "boky", "eve", "miki", "pla", "sugar"]; | ... | ... |
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +module.exports.checkWallet = async (req, res) => { | |
| 2 | + console.log('===== POST checkWallet =====') | |
| 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 | + console.log('body', req.body); | |
| 8 | + | |
| 9 | + // let response = `<XML> | |
| 10 | + // <STATUS>OK</STATUS> | |
| 11 | + // <DETAIL>SUCCESS</DETAIL> | |
| 12 | + // <SMID>1502000283578</SMID> | |
| 13 | + // </XML>` | |
| 14 | + | |
| 15 | + let response = { | |
| 16 | + "resultCode": 20000, | |
| 17 | + "resultDescription": "Success", | |
| 18 | + "data": { | |
| 19 | + "amount": "15.23", | |
| 20 | + "address": "dtfghvqi3h4tw87g8u9iq2", | |
| 21 | + "chain": "BSC", | |
| 22 | + "token": "USDT" | |
| 23 | + } | |
| 24 | + } | |
| 25 | + | |
| 26 | + let responseErr = { | |
| 27 | + "resultCode": 40401, | |
| 28 | + "resultDescription": "Data not found" | |
| 29 | + } | |
| 30 | + | |
| 31 | + res.status(200).send(response) | |
| 32 | +} | |
| 0 | 33 | \ No newline at end of file | ... | ... |
loadtest.js
| ... | ... | @@ -53,9 +53,9 @@ function statusCallback(error, result, latency) { |
| 53 | 53 | // }; |
| 54 | 54 | |
| 55 | 55 | const options = { |
| 56 | - url: 'http://localhost:9011/api/v1/register/scanDevice/TpZ3EgSQ', | |
| 56 | + url: 'http://10.1.2.136:9201/api/v1/register/scanDevice/TpZ3EgSQ', | |
| 57 | 57 | maxRequests: 1000, |
| 58 | - requestsPerSecond: 100, | |
| 58 | + requestsPerSecond: 30, | |
| 59 | 59 | headers : { |
| 60 | 60 | "Content-Type":"application/json", |
| 61 | 61 | "x-transaction-id":"NI5smn3wWpoPX1ma2jbPiE8hK4QcDqHR1582013702233", | ... | ... |
| ... | ... | @@ -0,0 +1,140 @@ |
| 1 | +module.exports.getAccountDestination = async (req, res) => { | |
| 2 | + console.log('===== GET getAccountDestination =====') | |
| 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 | + console.log('body', req.body); | |
| 8 | + | |
| 9 | + let response = { | |
| 10 | + "DestinationInfo": [ | |
| 11 | + { | |
| 12 | + "DestinationId": "61236752144b7900018138c4", | |
| 13 | + "AccountId": "60e6e33ae5f6facdc31b5a6d", | |
| 14 | + "DestinationName": "destination", | |
| 15 | + "DestinationUrl": "http://routeapi.quasar.svc.cluster.local/services/destination", | |
| 16 | + "DestinationStatus": "Enabled", | |
| 17 | + "Mode": "Raw", | |
| 18 | + "PickOutSensor": [], | |
| 19 | + "EventType": [ | |
| 20 | + "Report", | |
| 21 | + "Desire", | |
| 22 | + "Connection" | |
| 23 | + ], | |
| 24 | + "CustomHeaders": { | |
| 25 | + "x-ais-AccountKey": "60e6e33ae5f6facdc31b5a6d" | |
| 26 | + }, | |
| 27 | + "Things": [ | |
| 28 | + "60e80fdd252ddf0001b25180", | |
| 29 | + "611b93e7af8b3f0001e0acc7" | |
| 30 | + ], | |
| 31 | + "QueueStorageStatus": "Disabled", | |
| 32 | + "LastQueueStorageStatusTimestamp": "0001-01-01T06:43:00+06:43", | |
| 33 | + "ErrorCount": 0, | |
| 34 | + "CustomProperties": { | |
| 35 | + "ForwardDetail": { | |
| 36 | + "ThingId": true, | |
| 37 | + "ThingName": true, | |
| 38 | + "ThingToken": true, | |
| 39 | + "ThingIdentifier": true, | |
| 40 | + "IMEI": true, | |
| 41 | + "ThingCustomDetails": true | |
| 42 | + } | |
| 43 | + }, | |
| 44 | + "Authentications": { | |
| 45 | + "AuthenType": "NONE" | |
| 46 | + }, | |
| 47 | + "CreatedDatetime": "2021-07-09T15:55:17+07:00", | |
| 48 | + "LastUpdatedTimestamp": "2021-08-20T21:25:19+07:00" | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + "DestinationId": "61166341144b7900017e5630", | |
| 52 | + "AccountId": "60e6e33ae5f6facdc31b5a6d", | |
| 53 | + "DestinationName": "cdddddddddddddddddddddddddddddddd", | |
| 54 | + "DestinationUrl": "https://mg-iot.siamimo.com/provisioningmessagesharingapis/index.html", | |
| 55 | + "DestinationStatus": "Enabled", | |
| 56 | + "Mode": "Raw", | |
| 57 | + "PickOutSensor": [], | |
| 58 | + "EventType": [ | |
| 59 | + "NONE" | |
| 60 | + ], | |
| 61 | + "CustomHeaders": {}, | |
| 62 | + "Things": [ | |
| 63 | + "611a21caaf8b3f0001dd63f4" | |
| 64 | + ], | |
| 65 | + "QueueStorageStatus": "Disabled", | |
| 66 | + "LastQueueStorageStatusTimestamp": "0001-01-01T06:43:00+06:43", | |
| 67 | + "ErrorCount": 0, | |
| 68 | + "CustomProperties": { | |
| 69 | + "ForwardDetail": { | |
| 70 | + "ThingId": true, | |
| 71 | + "ThingName": true, | |
| 72 | + "ThingToken": true, | |
| 73 | + "ThingIdentifier": true, | |
| 74 | + "IMEI": true, | |
| 75 | + "ThingCustomDetails": true | |
| 76 | + } | |
| 77 | + }, | |
| 78 | + "Authentications": { | |
| 79 | + "AuthenType": "NONE" | |
| 80 | + }, | |
| 81 | + "CreatedDatetime": "2021-08-13T19:19:13+07:00", | |
| 82 | + "LastUpdatedTimestamp": "2021-08-13T23:22:13+07:00" | |
| 83 | + } | |
| 84 | + ], | |
| 85 | + "@Metadata": { | |
| 86 | + "CurrentPage": 1, | |
| 87 | + "TotalPages": 18, | |
| 88 | + "Top": 10, | |
| 89 | + "TotalCount": 172, | |
| 90 | + "HasPrevious": false, | |
| 91 | + "HasNext": true | |
| 92 | + }, | |
| 93 | + "OperationStatus": { | |
| 94 | + "Code": "20000", | |
| 95 | + "DeveloperMessage": "The requested operation was successfully." | |
| 96 | + } | |
| 97 | + } | |
| 98 | + | |
| 99 | + res.status(200).send(response) | |
| 100 | +} | |
| 101 | + | |
| 102 | +module.exports.getAccountThings = async (req, res) => { | |
| 103 | + console.log('===== GET getAccountThings =====') | |
| 104 | + console.log('url', req.originalUrl); | |
| 105 | + console.log('headers', req.headers); | |
| 106 | + console.log('query', req.query); | |
| 107 | + console.log('params', req.params); | |
| 108 | + console.log('body', req.body); | |
| 109 | + | |
| 110 | + let response = { | |
| 111 | + "ThingInfo": [ | |
| 112 | + { | |
| 113 | + "ThingId": "60e80fdd252ddf0001b25180", | |
| 114 | + "ThingName": "xNubula." | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + "ThingId": "611b93e7af8b3f0001e0acc7", | |
| 118 | + "ThingName": "xNubula.2" | |
| 119 | + }, | |
| 120 | + { | |
| 121 | + "ThingId": "611a21caaf8b3f0001dd63f4", | |
| 122 | + "ThingName": "xName 01" | |
| 123 | + } | |
| 124 | + ], | |
| 125 | + "@Metadata": { | |
| 126 | + "CurrentPage": 1, | |
| 127 | + "TotalPages": 1, | |
| 128 | + "Top": 10, | |
| 129 | + "TotalCount": 3, | |
| 130 | + "HasPrevious": false, | |
| 131 | + "HasNext": false | |
| 132 | + }, | |
| 133 | + "OperationStatus": { | |
| 134 | + "Code": "20000", | |
| 135 | + "DeveloperMessage": "The requested operation was successfully." | |
| 136 | + } | |
| 137 | + } | |
| 138 | + | |
| 139 | + res.status(200).send(response) | |
| 140 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +package main | |
| 2 | + | |
| 3 | +import ( | |
| 4 | + "fmt" | |
| 5 | + "math" | |
| 6 | +) | |
| 7 | + | |
| 8 | +func findRoots(a, b, c float64) (float64, float64) { | |
| 9 | + | |
| 10 | + x1 := ((-b) + math.Sqrt(math.Pow(b, 2)-(4*a*c)))/(2*a) | |
| 11 | + x2 := ((-b) - math.Sqrt(math.Pow(b, 2)-(4*a*c)))/(2*a) | |
| 12 | + | |
| 13 | + return x1, x2 | |
| 14 | +} | |
| 15 | + | |
| 16 | +func main() { | |
| 17 | + x1, x2 := findRoots(2, 10, 8) | |
| 18 | + fmt.Printf("Roots: %f, %f", x1, x2) | |
| 19 | +} | ... | ... |
postpay_true.js
| ... | ... | @@ -124,9 +124,9 @@ module.exports.getAccountCustomerInfo = async (req, res) => { |
| 124 | 124 | "withholdingTaxIndicator": "N", |
| 125 | 125 | "name": { |
| 126 | 126 | "branchCode": "", |
| 127 | - "nameType": "B", | |
| 128 | - "firstName": "", | |
| 129 | - "lastName": "", | |
| 127 | + "nameType": "I", | |
| 128 | + "firstName": "ทดสอบ", | |
| 129 | + "lastName": "นามสกุล", | |
| 130 | 130 | "organizationName": "มหาวิทยาลัยหอการค้าไทย", |
| 131 | 131 | "branchName": "", |
| 132 | 132 | "middleName": "", |
| ... | ... | @@ -227,9 +227,9 @@ module.exports.getAccountCustomerInfo = async (req, res) => { |
| 227 | 227 | }, |
| 228 | 228 | "name": { |
| 229 | 229 | "branchCode": "", |
| 230 | - "nameType": "B", | |
| 231 | - "firstName": "", | |
| 232 | - "lastName": "", | |
| 230 | + "nameType": "I", | |
| 231 | + "firstName": "ทดสอบ", | |
| 232 | + "lastName": "นามสกุล", | |
| 233 | 233 | "organizationName": "มหาวิทยาลัยหอการค้าไทย", |
| 234 | 234 | "branchName": "", |
| 235 | 235 | "middleName": "", |
| ... | ... | @@ -2002,7 +2002,7 @@ module.exports.getProductHistoryList = async (req, res) => { |
| 2002 | 2002 | "reasonDescription": "Default Request for restore from suspension from Reg CL", |
| 2003 | 2003 | "lastActivityDate": "2018-11-07T07:15:02.000+07:00", |
| 2004 | 2004 | "reasonCode": "DEFRS", |
| 2005 | - "status": "NONE" | |
| 2005 | + "status": "PSUS" | |
| 2006 | 2006 | }, |
| 2007 | 2007 | "linkPrevProductId": "", |
| 2008 | 2008 | "barringByRequestReasonCode": "DDSC", |
| ... | ... | @@ -2079,7 +2079,61 @@ module.exports.getProductHistoryList = async (req, res) => { |
| 2079 | 2079 | } |
| 2080 | 2080 | } |
| 2081 | 2081 | |
| 2082 | - res.status(200).send(response) | |
| 2082 | + let response1 = { | |
| 2083 | + "getProductHistoryListResponse":{ | |
| 2084 | + "return":{ | |
| 2085 | + "totalSize":"59", | |
| 2086 | + "productHistoryList":{ | |
| 2087 | + "size":"2", | |
| 2088 | + "subscriberStatusHistoryInfoArray":[ | |
| 2089 | + { | |
| 2090 | + "barringByRequestActivityDate":"2016-09-01T17:25:03.000+07:00", | |
| 2091 | + "barringByRequestIndicator":"N", | |
| 2092 | + "collectionStatus":{ | |
| 2093 | + "reasonDescription":"Default Request for restore from suspension from Reg CL", | |
| 2094 | + "lastActivityDate":"2018-11-07T07:15:02.000+07:00", | |
| 2095 | + "reasonCode":"DEFRS", | |
| 2096 | + "status":"" | |
| 2097 | + }, | |
| 2098 | + "linkPrevProductId":"", | |
| 2099 | + "barringByRequestReasonCode":"DDSC", | |
| 2100 | + "creditLimitAtSubStatus":{ | |
| 2101 | + "reasonDescription":"", | |
| 2102 | + "lastActivityDate":"", | |
| 2103 | + "reasonCode":"", | |
| 2104 | + "status":"NONE" | |
| 2105 | + }, | |
| 2106 | + "subscriberId":"1111841", | |
| 2107 | + "barringByRequestReasonDescription":"Delete Additional Offer", | |
| 2108 | + "creditStatus":{ | |
| 2109 | + "reasonDescription":"Restore from Suspension request from Credit Limit Collection", | |
| 2110 | + "lastActivityDate":"2017-07-30T12:23:44.000+07:00", | |
| 2111 | + "reasonCode":"MONRS", | |
| 2112 | + "status":"" | |
| 2113 | + }, | |
| 2114 | + "linkNextProductId":"", | |
| 2115 | + "effectiveDate":"2017-11-07T07:15:02.000+07:00", | |
| 2116 | + "status":{ | |
| 2117 | + "statusDate":"2016-09-01T17:32:41.000+07:00", | |
| 2118 | + "statusLastActivity":"16", | |
| 2119 | + "statusDescription":"Active", | |
| 2120 | + "statusReasonDescription":"Restore Subs - Found", | |
| 2121 | + "statusReasonCode":"RSP5", | |
| 2122 | + "lastActivityPathId":"78", | |
| 2123 | + "statusCode":"A" | |
| 2124 | + } | |
| 2125 | + } | |
| 2126 | + ] | |
| 2127 | + }, | |
| 2128 | + "calculatedPageSize":"2", | |
| 2129 | + "errorCode":"OSBbllngA00001", | |
| 2130 | + "message":"Success.", | |
| 2131 | + "uuid":"84943fc3-00c2-424b-a432-23860fcc7ad3" | |
| 2132 | + } | |
| 2133 | + } | |
| 2134 | +} | |
| 2135 | + | |
| 2136 | + res.status(200).send(response1) | |
| 2083 | 2137 | } |
| 2084 | 2138 | |
| 2085 | 2139 | module.exports.getPaymentList = async (req, res) => { | ... | ... |
sms.js
ssb.js
| ... | ... | @@ -360,6 +360,9 @@ module.exports.createNewRegistration = async (req, res) => { |
| 360 | 360 | { |
| 361 | 361 | "Name": "returnMessage", |
| 362 | 362 | "Value": "Error Order Creation: EB0183 : SIM Serial No. : 2014143597539 status can not register" |
| 363 | + }, { | |
| 364 | + "Name": "mobileNo", | |
| 365 | + "Value": "0911234567" | |
| 363 | 366 | } |
| 364 | 367 | ] |
| 365 | 368 | } | ... | ... |