feat(paper/live): 生命周期管理补全: paper停止/恢复(实走20:30 step跳过stopped)/删除(连带净值成交持仓挂单)/编辑(名称标的资金); live删除(运行中拒绝)/编辑(stopped才可改); 前端列表+结果页按钮/编辑弹窗/删除确认 [vps]
CI/CD / test (push) Successful in 10s
CI/CD / nas-deploy (push) Failing after 11s
CI/CD / nas-verify (push) Has been skipped

This commit is contained in:
2026-08-13 18:27:32 +08:00
parent d8c156e6de
commit ccf958c5d6
8 changed files with 488 additions and 8 deletions
+18
View File
@@ -124,3 +124,21 @@ export async function getLiveStatus(aid: number): Promise<LiveStatus> {
const { data } = await apiClient.get<LiveStatus>(`/live/${aid}/status`)
return data
}
export async function deleteLive(aid: number): Promise<{ account_id: number; deleted: boolean }> {
const { data } = await apiClient.delete(`/live/${aid}`)
return data
}
export interface LiveUpdateReq {
name?: string
account?: string
vt_symbol?: string
strategy_name?: string
interval?: string
}
export async function updateLive(aid: number, req: LiveUpdateReq): Promise<{ updated: boolean }> {
const { data } = await apiClient.put(`/live/${aid}`, req)
return data
}
+26
View File
@@ -124,3 +124,29 @@ export async function getPending(aid: number): Promise<PendingOrder[]> {
const { data } = await apiClient.get<PendingOrder[]>(`/paper/${aid}/pending`)
return data
}
export async function stopPaper(aid: number): Promise<{ account_id: number; status: string }> {
const { data } = await apiClient.post(`/paper/${aid}/stop`)
return data
}
export async function resumePaper(aid: number): Promise<{ account_id: number; status: string }> {
const { data } = await apiClient.post(`/paper/${aid}/resume`)
return data
}
export async function deletePaper(aid: number): Promise<{ account_id: number; deleted: boolean }> {
const { data } = await apiClient.delete(`/paper/${aid}`)
return data
}
export interface PaperUpdateReq {
name?: string
symbols?: string[]
initial_capital?: number
}
export async function updatePaper(aid: number, req: PaperUpdateReq): Promise<{ updated: boolean }> {
const { data } = await apiClient.put(`/paper/${aid}`, req)
return data
}