协议修改

This commit is contained in:
chen wei bo
2025-09-08 19:44:58 +08:00
parent e7cb527ca0
commit d4d3e986b3
17 changed files with 878 additions and 66 deletions
@@ -7,14 +7,36 @@ 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",
// 上报聊天数据
async reqChatMsg(req: proto.cs.ICSChatMsgReq): Promise<ApiResponse<proto.cs.ICSChatMsgRes>> {
const ep: Endpoint<proto.cs.ICSChatMsgReq, proto.cs.ICSChatMsgRes> = {
path: "api/logic/chatMsg",
method: "POST",
codec: "json",
needsAuth: true,
};
return this.api.call(ep, req);
}
// 获取聊天数据
async reqGetChatMsg(req: proto.cs.ICSGetChatMsgReq): Promise<ApiResponse<proto.cs.ICSGetChatMsgRes>> {
const ep: Endpoint<proto.cs.ICSGetChatMsgReq, proto.cs.ICSGetChatMsgRes> = {
path: "api/logic/getChatMsg",
method: "POST",
codec: "json",
needsAuth: true,
};
return this.api.call(ep, req);
}
// 获取技师聊天次数
async reqChatCountData(req: proto.cs.ICSGetChatRemainCountReq): Promise<ApiResponse<proto.cs.ICSGetChatRemainCountRes>> {
const ep: Endpoint<proto.cs.ICSGetChatRemainCountReq, proto.cs.ICSGetChatRemainCountRes> = {
path: "api/logic/getChatRemainCount",
method: "POST",
codec: "json",
needsAuth: true,
};
return this.api.call(ep, req);
}
}