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