mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: database structure update
This commit is contained in:
1 parent
dca8e28361
commit
4daf8bac80
24 files changed
+182
-263
No files matched your search
@@ -5,7 +5,7 @@ import {
|
||||
} from 'hydrooj';
|
||||
|
||||
const dst = global.Hydro.service.db;
|
||||
const { discussion, document } = global.Hydro.model;
|
||||
const { discussion } = global.Hydro.model;
|
||||
const map = {};
|
||||
|
||||
const pid = (id) => {
|
||||
@@ -201,6 +201,7 @@ const tasks = {
|
||||
userfile_usage: null,
|
||||
},
|
||||
record: async (doc) => {
|
||||
if (doc.hidden) return null;
|
||||
const testCases: TestCase[] = [];
|
||||
for (const c of doc.cases || []) {
|
||||
testCases.push({
|
||||
@@ -227,16 +228,10 @@ const tasks = {
|
||||
judgeTexts: doc.judge_texts || [],
|
||||
compilerTexts: doc.compiler_texts || [],
|
||||
testCases,
|
||||
hidden: !!doc.hidden,
|
||||
rejudged: !!doc.rejudged,
|
||||
};
|
||||
if (doc.rejudged) rdoc.rejudged = true;
|
||||
if (doc.tid) {
|
||||
rdoc.contest = {
|
||||
type: doc.ttype || document.TYPE_CONTEST,
|
||||
tid: doc.tid,
|
||||
};
|
||||
}
|
||||
if (doc.tid) rdoc.contest = doc.tid;
|
||||
return rdoc;
|
||||
},
|
||||
domain: {
|
||||
|
||||
Reference in new issue
Block a user