(domainId: string, page = 1)
| 25 | class DomainRankHandler extends Handler { |
| 26 | @query('page', Types.PositiveInt, true) |
| 27 | async get(domainId: string, page = 1) { |
| 28 | const [dudocs, upcount, ucount] = await this.paginate( |
| 29 | domain.getMultiUserInDomain(domainId, { uid: { $gt: 1 }, rp: { $gt: 0 }, join: true }).sort({ rp: -1 }), |
| 30 | page, |
| 31 | 'ranking', |
| 32 | ); |
| 33 | const udict = await user.getList(domainId, dudocs.map((dudoc) => dudoc.uid)); |
| 34 | const udocs = dudocs.map((i) => udict[i.uid]); |
| 35 | this.response.template = 'ranking.html'; |
| 36 | this.response.body = { |
| 37 | udocs, upcount, ucount, page, |
| 38 | }; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | class ManageHandler extends Handler { |
no test coverage detected