feat: 增加业务提供项管理与详情接口
This commit is contained in:
1 parent
a73e377f91
commit
066f6595e4
4 files changed
+152
No files matched your search
@@ -108,6 +108,20 @@ export interface BrandTemplateDefinition {
|
||||
serviceCategories: string[];
|
||||
trustContentTypes: string[];
|
||||
}
|
||||
export interface Offering {
|
||||
id: string;
|
||||
brandId?: string;
|
||||
kind: "service" | "product" | "package" | "subscription";
|
||||
name: string;
|
||||
summary?: string | null;
|
||||
description?: string | null;
|
||||
coverUrl?: string | null;
|
||||
priceText?: string | null;
|
||||
priceAmount?: number | null;
|
||||
isEnabled: boolean;
|
||||
sortOrder: number;
|
||||
config?: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export class ApiClientError extends Error {
|
||||
constructor(
|
||||
@@ -218,6 +232,24 @@ export class ApiClient {
|
||||
getPublicTemplate(key: "personal" | "food"): Promise<BrandTemplateDefinition> {
|
||||
return this.request(`/public/templates/${key}`);
|
||||
}
|
||||
getPublicOffering(id: string): Promise<Offering> {
|
||||
return this.request(`/public/offerings/${encodeURIComponent(id)}`);
|
||||
}
|
||||
listAdminOfferings(): Promise<Offering[]> {
|
||||
return this.request("/admin/workspace/offerings");
|
||||
}
|
||||
createAdminOffering(body: Omit<Offering, "id" | "brandId">): Promise<Offering> {
|
||||
return this.request("/admin/workspace/offerings", { method: "POST", body });
|
||||
}
|
||||
updateAdminOffering(
|
||||
id: string,
|
||||
body: Partial<Omit<Offering, "id" | "brandId">>,
|
||||
): Promise<Offering> {
|
||||
return this.request(`/admin/workspace/offerings/${encodeURIComponent(id)}`, {
|
||||
method: "PATCH",
|
||||
body,
|
||||
});
|
||||
}
|
||||
updateAdminService(id: string, body: ServiceUpdate): Promise<PublicService> {
|
||||
return this.request(`/admin/config/services/${encodeURIComponent(id)}`, {
|
||||
method: "PATCH",
|
||||
|
||||
Reference in new issue
Block a user