(domainId: string, tid: ObjectId)
| 710 | export class ContestUserHandler extends ContestManagementBaseHandler { |
| 711 | @param('tid', Types.ObjectId) |
| 712 | async get(domainId: string, tid: ObjectId) { |
| 713 | const tsdocs = await contest.getMultiStatus(domainId, { docId: tid }).project({ |
| 714 | uid: 1, attend: 1, startAt: 1, unrank: 1, endAt: 1, |
| 715 | }).toArray(); |
| 716 | for (const tsdoc of tsdocs) { |
| 717 | if (this.tdoc.duration && tsdoc.startAt) { |
| 718 | tsdoc.endAt = moment.min([ |
| 719 | moment(tsdoc.startAt).add(this.tdoc.duration, 'hours'), |
| 720 | moment(this.tdoc.endAt), |
| 721 | ...(tsdoc.endAt ? [moment(tsdoc.endAt)] : []), |
| 722 | ]).toDate(); |
| 723 | } |
| 724 | } |
| 725 | const udict = await user.getListForRender( |
| 726 | domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)], |
| 727 | this.user.hasPerm(PERM.PERM_VIEW_USER_PRIVATE_INFO), |
| 728 | ); |
| 729 | this.response.body = { tdoc: this.tdoc, tsdocs, udict }; |
| 730 | this.response.pjax = 'partials/contest_user.html'; |
| 731 | this.response.template = 'contest_user.html'; |
| 732 | } |
| 733 | |
| 734 | @param('tid', Types.ObjectId) |
| 735 | @param('uids', Types.NumericArray) |
nothing calls this directly
no test coverage detected