core: interface: remove unused collections

This commit is contained in:
undefined committed 2022-09-30 02:45:28 +08:00
1 parent f77dd8dc98
commit 15b88f00a9
6 files changed
+7 -14

No files matched your search

-1
View File
@@ -63,7 +63,6 @@
"@types/koa-router": "^7.4.4",
"@types/koa-static-cache": "^5.1.1",
"@types/lodash": "^4.14.184",
"@types/lru-cache": "^7.10.10",
"@types/mime-types": "^2.1.1",
"@types/minio": "^7.0.13",
"@types/mongodb": "^3.6.20",
-1
View File
@@ -21,7 +21,6 @@ function provideModule<T extends keyof ModuleInterfaces>(type: T, id: string, mo
export interface Context {
[Context.events]: Events<this>;
options: Context.Config;
loader: Loader;
Route: typeof import('./service/server').Route;
Connection: typeof import('./service/server').Connection;
+3 -8
View File
@@ -246,7 +246,7 @@ declare module './model/problem' {
export type { ProblemDoc } from './model/problem';
export type ProblemDict = NumericDictionary<ProblemDoc>;
export interface StatusDoc {
export interface StatusDocBase {
_id: ObjectID,
docId: any,
docType: number,
@@ -254,7 +254,7 @@ export interface StatusDoc {
uid: number,
}
export interface ProblemStatusDoc extends StatusDoc {
export interface ProblemStatusDoc extends StatusDocBase {
docId: number;
docType: 10;
rid?: ObjectID;
@@ -609,14 +609,12 @@ export interface OauthMap {
export interface Collections {
'blacklist': BlacklistDoc;
'contest': Tdoc;
'domain': DomainDoc;
'domain.user': any;
'domain.union': DomainUnion;
'record': RecordDoc;
'document': any;
'document.status': any;
'problem': ProblemDoc;
'document.status': StatusDocBase;
'user': Udoc;
'user.preference': UserPreferenceDoc;
'vuser': VUdoc;
@@ -632,9 +630,6 @@ export interface Collections {
'oplog': OplogDoc;
'event': EventDoc;
'opcount': OpCountDoc;
'log': any;
'fs.chunks': any;
'fs.files': any;
}
export interface Model {
+1 -1
View File
@@ -179,7 +179,7 @@ const acm = buildContestRule({
{ $match: { 'detail.status': STATUS.STATUS_ACCEPTED } },
{ $sort: { 'detail.rid': 1 } },
{ $group: { _id: '$detail.pid', first: { $first: '$detail.rid' } } },
]).toArray();
]).toArray() as any[];
for (const t of data) first[t._id] = t.first.generationTime;
const columns = await this.scoreboardHeader(isExport, _, tdoc, pdict);
+1 -1
View File
@@ -306,7 +306,7 @@ export async function setIfNotStatus<T extends keyof DocStatusType, K extends ke
domainId: string, docType: T, docId: DocStatusType[T]['docId'], uid: number,
key: K, value: DocStatusType[T][K], ifNot: DocStatusType[T][K], args: Partial<DocStatusType[T]>,
): Promise<DocStatusType[T]> {
const current = await collStatus.findOne({ domainId, docType, docId, uid }) || {};
const current: Partial<DocStatusType[T]> = await collStatus.findOne({ domainId, docType, docId, uid }) || {};
if (typeof key === 'string' && key.includes('.')) {
const acc = key.split('.');
let c = current;
+2 -2
View File
@@ -1,6 +1,6 @@
import { escapeRegExp, pick, uniq } from 'lodash';
import LRU from 'lru-cache';
import { Collection, ObjectID } from 'mongodb';
import { Collection, FilterQuery, ObjectID } from 'mongodb';
import { LoginError, UserAlreadyExistError, UserNotFoundError } from '../error';
import {
FileInfo, GDoc, ownerInfo,
@@ -336,7 +336,7 @@ class UserModel {
return uid;
}
static getMulti(params: any = {}) {
static getMulti(params: FilterQuery<Udoc> = {}) {
return coll.find(params);
}