task-103(任务与重复分析中心): 实现视频任务列表/卡片加载
新增 image-video-model.ts(snake 任务行解析、videos 安全地址与展平为视频卡片) 与 image-video-api.ts(GET /api/admin/image-video-tasks 加载适配)。 TDD: task-103.test.ts 8 用例先 RED 后 GREEN。
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/** 视频任务列表加载适配(任务 103):GET /api/admin/image-video-tasks + 筛选归一与解析。 */
|
||||
import { http } from '@/api/http'
|
||||
import { parseImageVideoPage, type ImageVideoPageResult } from './image-video-model.ts'
|
||||
import { toImageVideoQuery, type ImageVideoFilter } from './image-video-filter.ts'
|
||||
|
||||
export const IMAGE_VIDEO_TASKS_ENDPOINT = '/api/admin/image-video-tasks'
|
||||
|
||||
export async function fetchImageVideoTasks(
|
||||
filter: ImageVideoFilter,
|
||||
page: number,
|
||||
pageSize: number,
|
||||
): Promise<ImageVideoPageResult> {
|
||||
const { data } = await http.get<unknown>(IMAGE_VIDEO_TASKS_ENDPOINT, {
|
||||
params: toImageVideoQuery(filter, page, pageSize),
|
||||
})
|
||||
return parseImageVideoPage(data)
|
||||
}
|
||||
Reference in New Issue
Block a user