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

76 lines
2.6 KiB
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 { IGirlService } from "./IGirlService";
export class HttpGirlService implements IGirlService {
constructor(private api = ApiClient.I) {}
// 每日推荐
async reqDailyRecommend(req: proto.cs.ICSDailyRecommendReq): Promise<ApiResponse<proto.cs.ICSDailyRecommendRes>> {
let epData: Endpoint<proto.cs.ICSDailyRecommendReq, proto.cs.ICSDailyRecommendRes> = {
path: "api/logic/dailyRecommend",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
// 获取技师列表
async reqGetGirlList(req: proto.cs.ICSGetGirlListReq): Promise<ApiResponse<proto.cs.ICSGetGirlListRes>> {
let epData: Endpoint<proto.cs.ICSGetGirlListReq, proto.cs.ICSGetGirlListRes> = {
path: "api/logic/getGirls",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
// 获取技师详细信息
async reqGetGirlDetail(req: proto.cs.ICSGetGirlDetailReq): Promise<ApiResponse<proto.cs.ICSGetGirlDetailRes>> {
let epData: Endpoint<proto.cs.ICSGetGirlDetailReq, proto.cs.ICSGetGirlDetailRes> = {
path: "api/logic/girlDetail",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
// 解锁技师
async reqUnlockGirl(req: proto.cs.ICSUnlockGirlReq): Promise<ApiResponse<proto.cs.ICSUnlockGirlRes>> {
let epData: Endpoint<proto.cs.ICSUnlockGirlReq, proto.cs.ICSUnlockGirlRes> = {
path: "api/logic/unlockGirl",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
// 解锁资源
async reqUnlockGirlRes(req: proto.cs.ICSUnlockResourceReq): Promise<ApiResponse<proto.cs.ICSUnlockResourceRes>> {
let epData: Endpoint<proto.cs.ICSUnlockResourceReq, proto.cs.ICSUnlockResourceRes> = {
path: "api/logic/unlockResource",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
// 获取可聊天的技师数据
async reqCanChatGirlData(req: proto.cs.ICSGetLastChatListReq): Promise<ApiResponse<proto.cs.ICSGetLastChatListRes>> {
let epData: Endpoint<proto.cs.ICSGetLastChatListReq, proto.cs.ICSGetLastChatListRes> = {
path: "api/logic/getLastChat",
method: "POST",
codec: "json",
needsAuth: true
};
return this.api.call(epData, req);
}
}