21 lines
723 B
TypeScript
21 lines
723 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 { IPlayerDataService } from "./IPlayerDataService";
|
|
|
|
export class HttpPlayerDataService implements IPlayerDataService {
|
|
constructor(private api = ApiClient.I) {}
|
|
|
|
// 获取个人信息
|
|
async reqMyInfo(req: proto.cs.ICSMyInfoReq): Promise<ApiResponse<proto.cs.ICSMyInfoRes>> {
|
|
const ep: Endpoint<proto.cs.ICSMyInfoReq, proto.cs.ICSMyInfoRes> = {
|
|
path: "api/acc/info",
|
|
method: "POST",
|
|
codec: "json",
|
|
needsAuth: true,
|
|
};
|
|
return this.api.call(ep, req);
|
|
}
|
|
}
|