21 lines
708 B
TypeScript
21 lines
708 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 { IChatService } from "./IChatService";
|
|
|
|
export class HttpChatService implements IChatService {
|
|
constructor(private api = ApiClient.I) {}
|
|
|
|
// 购买聊天次数
|
|
async reqBuyChat(req: proto.cs.ICSBuyChatReq): Promise<ApiResponse<proto.cs.ICSBuyChatRes>> {
|
|
const ep: Endpoint<proto.cs.ICSBuyChatReq, proto.cs.ICSBuyChatRes> = {
|
|
path: "api/logic/buyChat",
|
|
method: "POST",
|
|
codec: "json",
|
|
needsAuth: true,
|
|
};
|
|
return this.api.call(ep, req);
|
|
}
|
|
}
|