进一步完善 ApiManager
This commit is contained in:
@@ -1,12 +1,22 @@
|
|||||||
import BaseApi from './BaseApi.ts'
|
import BaseApi from './BaseApi.ts'
|
||||||
import HttpServerLike from '../types/HttpServerLike.ts'
|
import HttpServerLike from '../types/HttpServerLike.ts'
|
||||||
|
import UserApi from "./UserApi.ts"
|
||||||
|
import SocketIo from "socket.io"
|
||||||
|
|
||||||
export default class ApiManager {
|
export default class ApiManager {
|
||||||
static httpServer: HttpServerLike
|
static httpServer: HttpServerLike
|
||||||
static init(httpServer: HttpServerLike) {
|
static socketIoServer: SocketIo.Server
|
||||||
|
static apis_instance: {}
|
||||||
|
static init(httpServer: HttpServerLike, socketIoServer: SocketIo.Server) {
|
||||||
this.httpServer = httpServer
|
this.httpServer = httpServer
|
||||||
|
this.socketIoServer = socketIoServer
|
||||||
}
|
}
|
||||||
static getHttpServer() {
|
static getHttpServer() {
|
||||||
return this.httpServer
|
return this.httpServer
|
||||||
}
|
}
|
||||||
|
static initAllApis() {
|
||||||
|
this.apis_instance = {
|
||||||
|
user: new UserApi()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user