提交 866acd45 authored 作者: 陈泽健's avatar 陈泽健

feat(performance): 合并报告前端 API 封装

- getProjectReport / getBatchReport / getProjectReports 三个 API 函数
- 对应后端 /projects/{id}/report /batch-reports/{id} /projects/{id}/reports 路由
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
上级 09e64690
......@@ -23,6 +23,8 @@ import type {
PerformanceProjectStats,
BatchRunRequest,
BatchRunResponse,
ProjectReportResponse,
ProjectReportListResponse,
} from '@/types/performance'
const BASE = '/api/performance'
......@@ -216,3 +218,23 @@ export function batchRunTasks(data: BatchRunRequest): Promise<BatchRunResponse>
export function runProjectAll(projectId: string): Promise<BatchRunResponse> {
return request.post(`${BASE}/projects/${projectId}/run-all`)
}
// ==================== 合并报告 ====================
/** 获取项目最新合并报告 */
export function getProjectReport(projectId: string): Promise<ProjectReportResponse> {
return request.get(`${BASE}/projects/${projectId}/report`)
}
/** 按批次ID获取合并报告 */
export function getBatchReport(batchId: string): Promise<ProjectReportResponse> {
return request.get(`${BASE}/batch-reports/${batchId}`)
}
/** 获取项目历史合并报告列表 */
export function getProjectReports(projectId: string, params?: {
page?: number
pageSize?: number
}): Promise<ProjectReportListResponse> {
return request.get(`${BASE}/projects/${projectId}/reports`, { params })
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论