重构后端,完善获取资源/下载列表、博客列表接口
This commit is contained in:
16
Server/src/Plugs/API/API.ts
Normal file
16
Server/src/Plugs/API/API.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import Logger from "../Logger";
|
||||
|
||||
abstract class API {
|
||||
|
||||
protected logger: Logger;
|
||||
public middlewareFunc: Function[] = [];
|
||||
constructor(public method: string, public uri: string, ...func: any) {
|
||||
this.logger = new Logger('API][' + method + '][' + uri);
|
||||
this.middlewareFunc.push(...func);
|
||||
}
|
||||
|
||||
// to override
|
||||
public abstract onRequset(data: any, res: any): void;
|
||||
}
|
||||
|
||||
export { API };
|
||||
Reference in New Issue
Block a user