1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-17 16:20:25 +08:00

finish filelist/file

This commit is contained in:
源文雨
2023-03-16 23:06:53 +08:00
parent df5bc78d4b
commit 57b32e609f
4 changed files with 221 additions and 129 deletions

View File

@@ -1,6 +1,6 @@
import { defHttp } from '/@/utils/http/axios'
import { getFileListModel, FilePercent, DelFile, AnalyzeFile } from './model/fileListModel'
import { DownloadFile } from './model/fileModel'
import { DownloadFile, FileStatus } from './model/fileModel'
enum Api {
GetFileList = '/getFileList',
@@ -8,6 +8,7 @@ enum Api {
DelFile = '/delFile',
AnalyzeFile = '/analyzeFile',
DlFile = '/dlFile',
GetFileStatus = '/getFileStatus',
}
/**
@@ -44,3 +45,10 @@ export const analyzeFile = (id: number) => {
export const downloadFile = (id: number) => {
return defHttp.get<DownloadFile>({ url: Api.DlFile, params: { id: id } })
}
/**
* @description: Get file status
*/
export const getFileStatus = (id: number) => {
return defHttp.get<FileStatus>({ url: Api.GetFileStatus, params: { id: id } })
}

View File

@@ -1,3 +1,21 @@
export interface DownloadFile {
url: string
}
export interface Question {
count: number
point: number
name: string
}
export interface Duplication {
percent: number
name: string
}
export interface FileStatus {
name: string
size: number
questions: Question[]
duplications: Duplication[]
}