This commit is contained in:
2026-04-27 14:23:19 +08:00
parent 09d3fe59b3
commit fa2dbb310b
75 changed files with 7363 additions and 1487 deletions

View File

@@ -0,0 +1,37 @@
import { ASSET_API_PATHS } from '../../editor/shared/editorApiClient';
import { requestJson } from '../apiClient';
export type PuzzleHistoryAsset = {
assetObjectId: string;
assetKind: 'puzzle_cover_image';
imageSrc: string;
ownerUserId?: string | null;
ownerLabel: string;
profileId?: string | null;
entityId?: string | null;
createdAt: string;
updatedAt: string;
};
/**
* 读取历史拼图图片素材。结果页只把它们作为参考图来源,
* 不直接替换当前正式图,正式图仍由后端单图生成链路写回。
*/
export async function listPuzzleHistoryAssets(payload: { limit?: number }) {
const params = new URLSearchParams({ kind: 'puzzle_cover_image' });
if (payload.limit) {
params.set('limit', String(payload.limit));
}
const response = await requestJson<{ assets: PuzzleHistoryAsset[] }>(
`${ASSET_API_PATHS.assetHistory}?${params.toString()}`,
{ method: 'GET' },
'读取历史拼图素材失败',
);
return response.assets;
}
export const puzzleAssetClient = {
listHistoryAssets: listPuzzleHistoryAssets,
};