feat: 新增前端 API 客户端

- 新增 edit.ts: 图片编辑 API 客户端
- 新增 health.ts: 健康检查 API 客户端
This commit is contained in:
2026-05-25 16:40:12 +08:00
parent f5ec4a6406
commit 77ffd0e58d
2 changed files with 31 additions and 0 deletions
+22
View File
@@ -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<EditImageResponse> {
return post<EditImageResponse>('/api/v1/images/edit', req)
}
+9
View File
@@ -0,0 +1,9 @@
import { get } from './client'
export interface HealthResponse {
status: string
}
export async function getHealth(): Promise<HealthResponse> {
return get<HealthResponse>('/api/v1/health')
}