refac: api 시스템 교체

- procDecorator의 타입 복잡도를 낮춤
- 타입 에러가 살짝 더 깔끔함
This commit is contained in:
2023-08-09 16:10:53 +00:00
parent 0c511d27c5
commit 81d16aaba2
12 changed files with 238 additions and 266 deletions
+6 -5
View File
@@ -1,16 +1,17 @@
import { GET } from "../defs";
import type { structure } from "../../apiStructure/sammoRootAPI";
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
import { declProcDecorators } from "../ProcDecorator/base";
type BaseAPI = typeof structure.Login.ReqNonce;
type RType = ExtractResponse<BaseAPI>;
type EType = ExtractError<BaseAPI>;
type QType = ExtractQuery<BaseAPI>;
const argValidator = undefined;
const procDecorator = [] as const;
export const ReqNonce = GET<RType, EType, QType>(argValidator)(procDecorator)(
(query, ctx, req, res) => {
export const ReqNonce = GET<RType, EType, QType>
(argValidator)
(declProcDecorators([] as const))
(() => {
throw new Error("Method not implemented.");
}
);
});