refactor: 重构文件目录系统

This commit is contained in:
SADYX
2024-07-15 14:27:34 +08:00
parent 83fc308eeb
commit 10726d7c4e
6 changed files with 418 additions and 223 deletions

View File

@ -1,43 +1,43 @@
import request from '@/config/axios'
// 文件目录 VO
export interface CategoryVO {
id: number // 主键
code: string // 编号
name: string // 文件夹名称
parentId: number // 父id
description: string // 描述
}
// 文件目录 API
export const CategoryApi = {
// 查询文件目录列表
getCategoryList: async (params) => {
return await request.get({ url: `/infra/category/list`, params })
},
// 查询文件目录详情
getCategory: async (id: number) => {
return await request.get({ url: `/infra/category/get?id=` + id })
},
// 新增文件目录
createCategory: async (data: CategoryVO) => {
return await request.post({ url: `/infra/category/create`, data })
},
// 修改文件目录
updateCategory: async (data: CategoryVO) => {
return await request.put({ url: `/infra/category/update`, data })
},
// 删除文件目录
deleteCategory: async (id: number) => {
return await request.delete({ url: `/infra/category/delete?id=` + id })
},
// 导出文件目录 Excel
exportCategory: async (params) => {
return await request.download({ url: `/infra/category/export-excel`, params })
},
}
import request from '@/config/axios'
// 文件目录 VO
export interface CategoryVO {
id: number // 主键
code: string // 编号
name: string // 文件夹名称
parentId: number // 父id
description: string // 描述
}
// 文件目录 API
export const CategoryApi = {
// 查询文件目录列表
getCategoryList: async (params?: any) => {
return await request.get({ url: `/infra/category/list`, params })
},
// 查询文件目录详情
getCategory: async (id: number) => {
return await request.get({ url: `/infra/category/get?id=` + id })
},
// 新增文件目录
createCategory: async (data: CategoryVO) => {
return await request.post({ url: `/infra/category/create`, data })
},
// 修改文件目录
updateCategory: async (data: CategoryVO) => {
return await request.put({ url: `/infra/category/update`, data })
},
// 删除文件目录
deleteCategory: async (id: number) => {
return await request.delete({ url: `/infra/category/delete?id=` + id })
},
// 导出文件目录 Excel
exportCategory: async (params?: any) => {
return await request.download({ url: `/infra/category/export-excel`, params })
}
}

View File

@ -4,6 +4,7 @@ export interface FilePageReqVO extends PageParam {
path?: string
type?: string
createTime?: Date[]
categoryId?: number
}
// 文件预签名地址 Response VO
@ -45,6 +46,6 @@ export const updateFile = (data: any) => {
}
// 上传文件
export const updateFileEx = (data: any) => {
return request.upload({ url: '/infra/file/uploadEx', data })
export const updateFileEx = (data: any, params?: any) => {
return request.upload({ url: '/infra/file/uploadEx', params, data })
}