mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
使用 @param 验证接口
This commit is contained in:
1 parent
4e85b696c0
commit
19cf1a5304
22 files changed
+657
-393
No files matched your search
@@ -511,9 +511,11 @@ export const ContestHandlerMixin = (c) => class extends c {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
async verifyProblems(domainId: string, pids: number[]) {
|
||||
await problem.getList(domainId, pids, true);
|
||||
return pids;
|
||||
async verifyProblems(domainId: string, pids: Array<number | string>) {
|
||||
const pdict = await problem.getList(domainId, pids, true);
|
||||
const _pids: Set<number> = new Set();
|
||||
for (const i in pdict) _pids.add(pdict[i].docId);
|
||||
return Array.from(_pids);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -116,7 +116,10 @@ export async function random<T>(domainId: string, query: FilterQuery<T>) {
|
||||
} return null;
|
||||
}
|
||||
|
||||
export async function getList(domainId: string, pids: number[], getHidden = false, doThrow = true) {
|
||||
export async function getList(
|
||||
domainId: string, pids: Array<number | string>,
|
||||
getHidden = false, doThrow = true,
|
||||
) {
|
||||
pids = Array.from(new Set(pids));
|
||||
const r = {};
|
||||
const q: any = { $or: [{ docId: { $in: pids } }, { pid: { $in: pids } }] };
|
||||
|
||||
Reference in new issue
Block a user