/** * 查重 API 函数 */ import apiClient from "../client" import type { DuplicationDetail, DuplicationRecord, DuplicationUploadResponse } from "./types" /** 上传视频进行查重 */ export const uploadForDuplication = async (file: File): Promise => { const formData = new FormData() formData.append("file", file) const response = await apiClient.post("/duplication/upload", formData, { headers: { "Content-Type": "multipart/form-data" }, }) return response.data } /** 获取查重记录列表 */ export const getDuplicationRecords = async (): Promise => { const response = await apiClient.get("/duplication/records") return response.data } /** 获取查重详情 */ export const getDuplicationDetail = async (recordId: string): Promise => { const response = await apiClient.get(`/duplication/records/${recordId}`) return response.data } /** 删除查重记录 */ export const deleteDuplicationRecord = async (recordId: string): Promise => { await apiClient.delete(`/duplication/records/${recordId}`) } /** 重新查重 */ export const retryDuplication = async (recordId: string): Promise => { const response = await apiClient.post(`/duplication/records/${recordId}/retry`) return response.data }