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 reqChatMsg(req: proto.cs.ICSChatMsgReq): Promise> { const ep: Endpoint = { path: "api/logic/chatMsg", method: "POST", codec: "json", needsAuth: true, }; return this.api.call(ep, req); } // 获取聊天数据 async reqGetChatMsg(req: proto.cs.ICSGetChatMsgReq): Promise> { const ep: Endpoint = { path: "api/logic/getChatMsg", method: "POST", codec: "json", needsAuth: true, }; return this.api.call(ep, req); } // 获取技师聊天次数 async reqChatCountData(req: proto.cs.ICSGetChatRemainCountReq): Promise> { const ep: Endpoint = { path: "api/logic/getChatRemainCount", method: "POST", codec: "json", needsAuth: true, }; return this.api.call(ep, req); } }