43 lines
1.5 KiB
TypeScript
43 lines
1.5 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);
|
||
|
|
}
|
||
|
|
}
|