refactor: 拆分 API Client 资源模块

This commit is contained in:
que01 committed 2026-10-12 03:37:05 +08:00
1 parent f3adf7bc15
commit 357f271639
24 files changed
+1280 -905

No files matched your search

@@ -0,0 +1,18 @@
import type { RequestFn } from "../client/request.js";
import type { PresignedUpload, UploadConfig } from "../types/media.js";
export interface MediaMethods {
getUploadConfig(): Promise<UploadConfig>;
createPresignedUpload(body: {
fileName: string;
contentType: string;
scope?: "brand" | "offering" | "trust";
}): Promise<PresignedUpload>;
}
export function mediaMethods({ request }: { request: RequestFn }): MediaMethods {
return {
getUploadConfig: () => request("/admin/uploads/config"),
createPresignedUpload: (body) => request("/admin/uploads/presign", { method: "POST", body }),
};
}