diff --git a/packages/hydrooj/src/entry/cli.ts b/packages/hydrooj/src/entry/cli.ts index 8b43e9654..543cd0bc3 100644 --- a/packages/hydrooj/src/entry/cli.ts +++ b/packages/hydrooj/src/entry/cli.ts @@ -4,7 +4,6 @@ import cac from 'cac'; import { ObjectID } from 'mongodb'; import { validate } from '../lib/validator'; import options from '../options'; -import * as bus from '../service/bus'; import db from '../service/db'; import { lib, model, script, service, diff --git a/packages/hydrooj/src/interface.ts b/packages/hydrooj/src/interface.ts index c553305b0..7bda7d316 100644 --- a/packages/hydrooj/src/interface.ts +++ b/packages/hydrooj/src/interface.ts @@ -517,7 +517,7 @@ export interface JudgeResultBody { time?: number; memory?: number; message?: string | JudgeMessage; - compilerText?: string, + compilerText?: string; } export interface Task { @@ -568,6 +568,13 @@ export interface OpCountDoc { opcount: number; } +export interface OauthMap { + /** source openId */ + _id: string; + /** target uid */ + uid: number; +} + export interface Collections { 'blacklist': BlacklistDoc; 'contest': Tdoc; @@ -582,11 +589,11 @@ export interface Collections { 'user.preference': UserPreferenceDoc; 'vuser': VUdoc; 'user.group': GDoc; - 'check': any; + 'check': System; 'message': MessageDoc; 'token': TokenDoc; 'status': any; - 'oauth': any; + 'oauth': OauthMap; 'system': System; 'task': Task; 'storage': FileNode; @@ -685,7 +692,6 @@ export interface HydroGlobal { script: Record, service: Service, lib: Lib, - stat: any, ui: UI, error: typeof import('./error'), Logger: typeof import('./logger').Logger, diff --git a/packages/hydrooj/src/model/oauth.ts b/packages/hydrooj/src/model/oauth.ts index 9eb83369b..93ddb4964 100644 --- a/packages/hydrooj/src/model/oauth.ts +++ b/packages/hydrooj/src/model/oauth.ts @@ -1,12 +1,6 @@ -import { Collection } from 'mongodb'; import db from '../service/db'; -interface OauthMap { - _id: string, // source openId - uid: number, // target uid -} - -const coll: Collection = db.collection('oauth'); +const coll = db.collection('oauth'); class OauthModel { static async get(_id: string) {