Files
18xchat/assets/Scripts/chat18x/network/services/PlayerDataService.ts
T

25 lines
867 B
TypeScript
Raw Normal View History

2025-08-18 15:22:54 +08:00
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';
export class PlayerDataService {
private static _I: PlayerDataService | null = null;
public static get I(): PlayerDataService {
if (!PlayerDataService._I) PlayerDataService._I = new PlayerDataService();
return PlayerDataService._I;
}
private constructor(private api = ApiClient.I) {}
2025-08-25 16:27:18 +08:00
// 获取个人信息
public async reqMyInfo(req: proto.cs.ICSMyInfoReq): Promise<ApiResponse<proto.cs.ICSMyInfoRes>> {
let epData: Endpoint<proto.cs.ICSMyInfoReq, proto.cs.ICSMyInfoRes> = {
path: "api/acc/info",
2025-08-18 15:22:54 +08:00
method: "POST",
codec: "json",
needsAuth: true
2025-08-19 18:32:09 +08:00
};
2025-08-18 15:22:54 +08:00
return this.api.call(epData, req);
}
}