MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / get

Method get

packages/hydrooj/src/handler/domain.ts:27–39  ·  view source on GitHub ↗
(domainId: string, page = 1)

Source from the content-addressed store, hash-verified

25class 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
42class ManageHandler extends Handler {

Callers 8

prepareMethod · 0.45
getMethod · 0.45
postSetUsersMethod · 0.45
getMethod · 0.45
prepareMethod · 0.45
getMethod · 0.45
domain.tsFile · 0.45

Calls 3

getMultiUserInDomainMethod · 0.80
paginateMethod · 0.65
getListMethod · 0.45

Tested by

no test coverage detected