21 lines
706 B
TypeScript
21 lines
706 B
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 { IShopService } from "./IShopService";
|
|
|
|
export class HttpShopService implements IShopService {
|
|
constructor(private api = ApiClient.I) {}
|
|
|
|
// 获取商品列表
|
|
async reqShopList(req: proto.cs.ICSGetShopReq): Promise<ApiResponse<proto.cs.ICSGetShopRes>> {
|
|
const ep: Endpoint<proto.cs.ICSGetShopReq, proto.cs.ICSGetShopRes> = {
|
|
path: "api/logic/shop",
|
|
method: "POST",
|
|
codec: "json",
|
|
needsAuth: true,
|
|
};
|
|
return this.api.call(ep, req);
|
|
}
|
|
}
|