test api
This commit is contained in:
@@ -3,9 +3,11 @@ import type { APINamespaceType } from "../defs";
|
||||
import { LoginByID } from "./LoginByID";
|
||||
import { LoginByToken } from "./LoginByToken";
|
||||
import { ReqNonce } from "./ReqNonce";
|
||||
import { test } from "./test";
|
||||
|
||||
export const Login = {
|
||||
LoginByID,
|
||||
LoginByToken,
|
||||
ReqNonce,
|
||||
test,
|
||||
} satisfies APINamespaceType<typeof structure.Login>;
|
||||
@@ -0,0 +1,18 @@
|
||||
import { GET } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
|
||||
type BaseAPI = typeof structure.Login.test;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
type EType = ExtractError<BaseAPI>;
|
||||
type QType = ExtractQuery<BaseAPI>;
|
||||
|
||||
export class test extends GET<RType, EType, QType>{
|
||||
protected ReqNonce = Symbol("ReqNonce");//TODO: remove this
|
||||
protected override async api(query: QType): Promise<RType | EType | true> {
|
||||
return {
|
||||
hello: "world",
|
||||
result: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user