协议修改
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user