Commit cdfd02d843a6ff4d9d21da89030e800e03f25e66
1 parent
86d300a7
Exists in
master
and in
1 other branch
update d01
Showing
1 changed file
with
14 additions
and
4 deletions
Show diff stats
d01.js
| ... | ... | @@ -428,17 +428,27 @@ module.exports.getGender = async (req, res) => { |
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | + let resultData = data | |
| 432 | + | |
| 433 | + if (req.query.offset) { | |
| 434 | + resultData = resultData.slice(+req.query.offset) | |
| 435 | + } | |
| 436 | + | |
| 437 | + if (req.query.limit) { | |
| 438 | + resultData = resultData.slice(0, +req.query.limit) | |
| 439 | + } | |
| 440 | + | |
| 431 | 441 | let response = { |
| 432 | 442 | "resultCode": "20000", |
| 433 | 443 | "resultDescription": "Success", |
| 434 | - "resultData": data, | |
| 444 | + "resultData": resultData, | |
| 435 | 445 | "rowCount": '' + data.length |
| 436 | 446 | } |
| 437 | 447 | res.send(response) |
| 438 | 448 | } |
| 439 | 449 | |
| 440 | 450 | module.exports.postGender = async (req, res) => { |
| 441 | - console.log('===== POST MemberLink =====') | |
| 451 | + console.log('===== POST Gender =====') | |
| 442 | 452 | console.log('url', req.originalUrl); |
| 443 | 453 | console.log('headers', req.headers); |
| 444 | 454 | console.log('query', req.query); |
| ... | ... | @@ -454,7 +464,7 @@ module.exports.postGender = async (req, res) => { |
| 454 | 464 | } |
| 455 | 465 | |
| 456 | 466 | module.exports.putGender = async (req, res) => { |
| 457 | - console.log('===== PUT MemberLink =====') | |
| 467 | + console.log('===== PUT Gender =====') | |
| 458 | 468 | console.log('url', req.originalUrl); |
| 459 | 469 | console.log('headers', req.headers); |
| 460 | 470 | console.log('query', req.query); |
| ... | ... | @@ -470,7 +480,7 @@ module.exports.putGender = async (req, res) => { |
| 470 | 480 | } |
| 471 | 481 | |
| 472 | 482 | module.exports.deleteGender = async (req, res) => { |
| 473 | - console.log('===== DELETE MemberLink =====') | |
| 483 | + console.log('===== DELETE Gender =====') | |
| 474 | 484 | console.log('url', req.originalUrl); |
| 475 | 485 | console.log('headers', req.headers); |
| 476 | 486 | console.log('query', req.query); | ... | ... |