mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
vjudge: support for adding solutions (#1030)
This commit is contained in:
1 parent
ea20debc97
commit
a255f53aa5
2 files changed
+3
-1
No files matched your search
@@ -4,7 +4,7 @@ import { LangConfig, STATUS } from '@hydrooj/common';
|
||||
import {
|
||||
Context, db, DomainModel, JudgeResultCallbackContext, Logger,
|
||||
ProblemModel, RecordModel, Service, SettingModel,
|
||||
sleep, SystemModel, TaskModel, Time, yaml,
|
||||
sleep, SolutionModel, SystemModel, TaskModel, Time, yaml,
|
||||
} from 'hydrooj';
|
||||
import { BasicProvider, IBasicProvider, RemoteAccount } from './interface';
|
||||
import providers from './providers/index';
|
||||
@@ -109,6 +109,7 @@ class AccountService {
|
||||
for (const key in res.data) {
|
||||
await ProblemModel.addTestdata(domainId, docId, key, res.data[key]);
|
||||
}
|
||||
if (res.solution) await SolutionModel.add(domainId, docId, 1, res.solution);
|
||||
logger.info(`${domainId}: problem ${docId}(${pid}) sync done -> ${targetPid}(${docId})`);
|
||||
} finally {
|
||||
delete syncing[`${domainId}/${pid}`];
|
||||
|
||||
@@ -35,6 +35,7 @@ export interface IBasicProvider {
|
||||
tag: string[];
|
||||
content: string;
|
||||
difficulty?: number;
|
||||
solution?: string;
|
||||
}>;
|
||||
entryProblemLists?: string[];
|
||||
listProblem: (page: number, resync: boolean, listId: string) => Promise<string[]>;
|
||||
|
||||
Reference in new issue
Block a user