This commit is contained in:
2026-04-29 11:51:04 +08:00
parent e191619ab3
commit 412279ae11
89 changed files with 3966 additions and 491 deletions

View File

@@ -2,4 +2,5 @@ export {
getPuzzleGalleryDetail,
listPuzzleGallery,
puzzleGalleryClient,
remixPuzzleGalleryWork,
} from './puzzleGalleryClient';

View File

@@ -2,6 +2,7 @@ import type {
PuzzleWorksResponse,
PuzzleWorkSummary,
} from '../../../packages/shared/src/contracts/puzzleWorkSummary';
import type { PuzzleAgentSessionSnapshot } from '../../../packages/shared/src/contracts/puzzleAgentSession';
import { type ApiRetryOptions, requestJson } from '../apiClient';
const PUZZLE_GALLERY_API_BASE = '/api/runtime/puzzle/gallery';
@@ -43,7 +44,21 @@ export async function getPuzzleGalleryDetail(profileId: string) {
);
}
/**
* 将公开拼图作品复制为当前用户的草稿。
*/
export async function remixPuzzleGalleryWork(profileId: string) {
return requestJson<{ session: PuzzleAgentSessionSnapshot }>(
`${PUZZLE_GALLERY_API_BASE}/${encodeURIComponent(profileId)}/remix`,
{
method: 'POST',
},
'Remix 拼图作品失败',
);
}
export const puzzleGalleryClient = {
getDetail: getPuzzleGalleryDetail,
list: listPuzzleGallery,
remix: remixPuzzleGalleryWork,
};