From 0000eeead22f31fe7ddc627c09a57d2c0766510c Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Thu, 14 Aug 2025 12:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E7=BC=96=E5=86=99=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E6=8E=A5=E5=8F=A3=E7=9B=B8=E5=85=B3=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ApiManager.ts | 12 ++++++++++++ src/api/BaseApi.ts | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/api/ApiManager.ts create mode 100644 src/api/BaseApi.ts diff --git a/src/api/ApiManager.ts b/src/api/ApiManager.ts new file mode 100644 index 0000000..c1b8aec --- /dev/null +++ b/src/api/ApiManager.ts @@ -0,0 +1,12 @@ +import BaseApi from './BaseApi.ts' +import HttpServerLike from '../types/HttpServerLike.ts' + +export default class ApiManager { + declare httpServer: HttpServerLike + static init(httpServer: HttpServerLike) { + this.httpServer = httpServer + } + static getHttpServer() { + return this.httpServer + } +} diff --git a/src/api/BaseApi.ts b/src/api/BaseApi.ts new file mode 100644 index 0000000..4ec0e15 --- /dev/null +++ b/src/api/BaseApi.ts @@ -0,0 +1,12 @@ +import UnknownFunction from '../types/UnknownFunction.ts' + +export default abstract class BaseApi { + abstract getName(): string + constructor() { + this.init() + } + abstract init(): void + registerEvent(name: string, func: UnknownFunction) { + + } +}