21 lines
738 B
TypeScript
21 lines
738 B
TypeScript
import { ApiClient } from "../client/ApiClient";
|
|||
|
|
import type { Endpoint } from "../client/endpoints";
|
||
|
|
import type { ApiResponse } from "../client/types";
|
||
|
|
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||
|
|
import type { ICommonService } from "./ICommonService";
|
||
|
|
|
||
|
|
export class HttpCommonService implements ICommonService {
|
||
|
|
constructor(private api = ApiClient.I) {}
|
||
|
|
|
||
|
|
// 获取配置
|
||
|
|
async reqResConfig(req: proto.cs.ICSGetResConfigReq): Promise<ApiResponse<proto.cs.ICSGetResConfigRes>> {
|
||
|
|
const ep: Endpoint<proto.cs.ICSGetResConfigReq, proto.cs.ICSGetResConfigRes> = {
|
||
|
|
path: "api/logic/getResConfig",
|
||
|
|
method: "POST",
|
||
|
|
codec: "json",
|
||
|
|
needsAuth: true,
|
||
|
|
};
|
||
|
|
return this.api.call(ep, req);
|
||
|
|
}
|
||
|
|
}
|