进一步完善 ApiManager

This commit is contained in:
CrescentLeaf
2025-08-16 16:07:24 +08:00
parent 8909a8d5f6
commit 4a35510192

View File

@@ -1,12 +1,22 @@
import BaseApi from './BaseApi.ts'
import HttpServerLike from '../types/HttpServerLike.ts'
import UserApi from "./UserApi.ts"
import SocketIo from "socket.io"
export default class ApiManager {
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.socketIoServer = socketIoServer
}
static getHttpServer() {
return this.httpServer
}
static initAllApis() {
this.apis_instance = {
user: new UserApi()
}
}
}