feat: 实现剧本创作与拆解前端工作台
This commit is contained in:
1 parent
edc003443f
commit
2ee6f049f6
56 files changed
+7597
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { optionalResource, request } from '../../lib/http'
|
||||
import type { BreakdownAction, BreakdownInput, BreakdownPreview, BreakdownState } from './types'
|
||||
|
||||
/** Breakdown API;预览为 GET,启动和恢复为等待完成的长 POST。 */
|
||||
export const breakdownApi = {
|
||||
preview: (id: string, input: BreakdownInput, signal?: AbortSignal) => {
|
||||
const query = new URLSearchParams({ groupSize: String(input.groupSize), modules: input.modules.join(',') })
|
||||
return request<BreakdownPreview>(`/projects/${encodeURIComponent(id)}/breakdown-preview?${query}`, { signal })
|
||||
},
|
||||
latest: (id: string, signal?: AbortSignal) =>
|
||||
optionalResource(request<BreakdownState>(`/projects/${encodeURIComponent(id)}/breakdown/latest`, { signal })),
|
||||
run: (id: string, action: BreakdownAction, input?: BreakdownInput) =>
|
||||
request<BreakdownState>(`/projects/${encodeURIComponent(id)}/breakdown/${action}`, {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user