mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
导出比赛代码功能
This commit is contained in:
1 parent
b54c22cb84
commit
9247b71b5f
11 files changed
+123
-69
No files matched your search
@@ -369,6 +369,14 @@ function _getStatusJournal(tsdoc) {
|
||||
return tsdoc.journal.sort((a, b) => (a.rid.generationTime - b.rid.generationTime));
|
||||
}
|
||||
|
||||
async function getAndListStatus(domainId, tid, docType = document.TYPE_CONTEST) {
|
||||
// TODO(iceboy): projection, pagination.
|
||||
const tdoc = await get(domainId, tid, docType);
|
||||
const tsdocs = await document.getMultiStatus(domainId, docType, { docId: tid })
|
||||
.sort(RULES[tdoc.rule].statusSort).toArray();
|
||||
return [tdoc, tsdocs];
|
||||
}
|
||||
|
||||
async function recalcStatus(domainId, tid, type) {
|
||||
const [tdoc, tsdocs] = await Promise.all([
|
||||
document.get(domainId, type, tid),
|
||||
@@ -404,6 +412,7 @@ global.Hydro.model.contest = module.exports = {
|
||||
count,
|
||||
getMulti,
|
||||
setStatus,
|
||||
getAndListStatus,
|
||||
recalcStatus,
|
||||
isNew,
|
||||
isUpcoming,
|
||||
|
||||
Reference in new issue
Block a user