()
| 4 | |
| 5 | class NewsController extends Controller { |
| 6 | async list() { |
| 7 | const { ctx, app } = this; |
| 8 | const pageSize = app.config.news.pageSize; |
| 9 | const page = parseInt(ctx.query.page) || 1; |
| 10 | |
| 11 | const idList = await ctx.service.hackerNews.getTopStories(page); |
| 12 | |
| 13 | ctx.body = { |
| 14 | list: idList, |
| 15 | page, pageSize, |
| 16 | }; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | module.exports = NewsController; |
nothing calls this directly
no test coverage detected