From 77ffd0e58d6b97e78dacaf68131c0d1761c103ef Mon Sep 17 00:00:00 2001 From: wonder Date: Mon, 25 May 2026 16:40:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=89=8D=E7=AB=AF=20?= =?UTF-8?q?API=20=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 edit.ts: 图片编辑 API 客户端 - 新增 health.ts: 健康检查 API 客户端 --- frontend/src/api/edit.ts | 22 ++++++++++++++++++++++ frontend/src/api/health.ts | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 frontend/src/api/edit.ts create mode 100644 frontend/src/api/health.ts diff --git a/frontend/src/api/edit.ts b/frontend/src/api/edit.ts new file mode 100644 index 0000000..a14525b --- /dev/null +++ b/frontend/src/api/edit.ts @@ -0,0 +1,22 @@ +import { post } from './client' + +export interface EditImageRequest { + image: string // base64 编码 + prompt: string + count?: number +} + +export interface EditAssetResponse { + data: string // base64 编码 + format: string +} + +export interface EditImageResponse { + assets: EditAssetResponse[] +} + +export async function editImage( + req: EditImageRequest, +): Promise { + return post('/api/v1/images/edit', req) +} diff --git a/frontend/src/api/health.ts b/frontend/src/api/health.ts new file mode 100644 index 0000000..79c6764 --- /dev/null +++ b/frontend/src/api/health.ts @@ -0,0 +1,9 @@ +import { get } from './client' + +export interface HealthResponse { + status: string +} + +export async function getHealth(): Promise { + return get('/api/v1/health') +}