Merge branch 'codex/backend-rewrite-spacetimedb' of http://82.157.175.59:3000/GenarrativeAI/Genarrative into codex/backend-rewrite-spacetimedb
# Conflicts: # server-rs/crates/spacetime-client/src/lib.rs # src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
This commit is contained in:
@@ -7,6 +7,12 @@ const BIG_FISH_WORKS_READ_RETRY: ApiRetryOptions = {
|
||||
baseDelayMs: 120,
|
||||
maxDelayMs: 360,
|
||||
};
|
||||
const BIG_FISH_WORKS_WRITE_RETRY: ApiRetryOptions = {
|
||||
maxRetries: 1,
|
||||
baseDelayMs: 120,
|
||||
maxDelayMs: 360,
|
||||
retryUnsafeMethods: true,
|
||||
};
|
||||
|
||||
/**
|
||||
* 读取当前用户的大鱼吃小鱼创作作品列表。
|
||||
@@ -24,6 +30,23 @@ export async function listBigFishWorks() {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除当前用户的大鱼吃小鱼作品,并返回删除后的作品列表。
|
||||
*/
|
||||
export async function deleteBigFishWork(sessionId: string) {
|
||||
return requestJson<BigFishWorksResponse>(
|
||||
`${BIG_FISH_WORKS_API_BASE}/${encodeURIComponent(sessionId)}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
},
|
||||
'删除大鱼吃小鱼作品失败',
|
||||
{
|
||||
retry: BIG_FISH_WORKS_WRITE_RETRY,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const bigFishWorksClient = {
|
||||
delete: deleteBigFishWork,
|
||||
list: listBigFishWorks,
|
||||
};
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
export { bigFishWorksClient, listBigFishWorks } from './bigFishWorksClient';
|
||||
export {
|
||||
bigFishWorksClient,
|
||||
deleteBigFishWork,
|
||||
listBigFishWorks,
|
||||
} from './bigFishWorksClient';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export {
|
||||
getPuzzleWorkDetail,
|
||||
deletePuzzleWork,
|
||||
listPuzzleWorks,
|
||||
puzzleWorksClient,
|
||||
updatePuzzleWork,
|
||||
|
||||
@@ -78,7 +78,24 @@ export async function updatePuzzleWork(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除当前用户的拼图作品,并返回删除后的作品列表。
|
||||
*/
|
||||
export async function deletePuzzleWork(profileId: string) {
|
||||
return requestJson<PuzzleWorksResponse>(
|
||||
`${PUZZLE_WORKS_API_BASE}/${encodeURIComponent(profileId)}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
},
|
||||
'删除拼图作品失败',
|
||||
{
|
||||
retry: PUZZLE_WORKS_WRITE_RETRY,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const puzzleWorksClient = {
|
||||
delete: deletePuzzleWork,
|
||||
getDetail: getPuzzleWorkDetail,
|
||||
list: listPuzzleWorks,
|
||||
update: updatePuzzleWork,
|
||||
|
||||
@@ -43,6 +43,7 @@ export {
|
||||
rpgCreationPreviewAdapter,
|
||||
} from './rpgCreationPreviewAdapter';
|
||||
export {
|
||||
deleteRpgCreationAgentSession,
|
||||
listRpgCreationWorks,
|
||||
rpgCreationWorkClient,
|
||||
} from './rpgCreationWorkClient';
|
||||
|
||||
@@ -11,9 +11,20 @@ export async function listRpgCreationWorks() {
|
||||
return Array.isArray(response?.items) ? response.items : [];
|
||||
}
|
||||
|
||||
export async function deleteRpgCreationAgentSession(sessionId: string) {
|
||||
const response = await requestRpgCreationRuntimeJson<ListRpgCreationWorksResponse>(
|
||||
`/custom-world/agent/sessions/${encodeURIComponent(sessionId)}`,
|
||||
{ method: 'DELETE' },
|
||||
'删除 RPG 草稿失败',
|
||||
);
|
||||
|
||||
return Array.isArray(response?.items) ? response.items : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作包 D 把作品列表请求正式迁入 RPG 创作域 client。
|
||||
*/
|
||||
export const rpgCreationWorkClient = {
|
||||
deleteAgentSession: deleteRpgCreationAgentSession,
|
||||
listWorks: listRpgCreationWorks,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user