init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
export {
getPuzzleGalleryDetail,
listPuzzleGallery,
puzzleGalleryClient,
} from './puzzleGalleryClient';

View File

@@ -0,0 +1,49 @@
import type {
PuzzleWorksResponse,
PuzzleWorkSummary,
} from '../../../packages/shared/src/contracts/puzzleWorkSummary';
import { type ApiRetryOptions, requestJson } from '../apiClient';
const PUZZLE_GALLERY_API_BASE = '/api/runtime/puzzle/gallery';
const PUZZLE_GALLERY_READ_RETRY: ApiRetryOptions = {
maxRetries: 1,
baseDelayMs: 120,
maxDelayMs: 360,
};
/**
* 读取拼图广场列表。
*/
export async function listPuzzleGallery() {
return requestJson<PuzzleWorksResponse>(
PUZZLE_GALLERY_API_BASE,
{
method: 'GET',
},
'读取拼图广场失败',
{
retry: PUZZLE_GALLERY_READ_RETRY,
},
);
}
/**
* 读取拼图广场详情。
*/
export async function getPuzzleGalleryDetail(profileId: string) {
return requestJson<{ item: PuzzleWorkSummary }>(
`${PUZZLE_GALLERY_API_BASE}/${encodeURIComponent(profileId)}`,
{
method: 'GET',
},
'读取拼图广场详情失败',
{
retry: PUZZLE_GALLERY_READ_RETRY,
},
);
}
export const puzzleGalleryClient = {
getDetail: getPuzzleGalleryDetail,
list: listPuzzleGallery,
};