9 changed files with 97 additions and 90 deletions
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
/** |
||||
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||
* author entfrm开发团队-王翔 |
||||
*/ |
||||
import type { FileParams, FileResult } from '/@/api/platform/system/entity/file'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
|
||||
enum Api { |
||||
list = '/system_proxy/system/file/list', |
||||
get = '/system_proxy/system/file', |
||||
getLocal = '/system_proxy/system/file/local', |
||||
del = '/system_proxy/system/file/remove' |
||||
} |
||||
|
||||
/** 查询文件列表 */ |
||||
export const listFile = (params?: Partial<FileParams>) => defHttp.get<FileResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
||||
|
||||
/** 获取文件 */ |
||||
export const getFile = (bucket: string, fileName: string) => defHttp.get({ url: `${Api.get}/${bucket}/${fileName}` }); |
||||
|
||||
/** 获取本地模板文件 */ |
||||
export const getLocalFile = (fileName: string) => defHttp.get({ url: `${Api.getLocal}/${fileName}` }); |
||||
|
||||
/** 删除文件 */ |
||||
export const delFile = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
/** |
||||
* @program: kicc-ui |
||||
* @description: 文件实体类 |
||||
* 类型定义 |
||||
* @author: entfrm开发团队-王翔 |
||||
* @create: 2022/4/8 |
||||
*/ |
||||
import { R } from '/#/axios'; |
||||
import { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||
|
||||
/** 文件查询参数 */ |
||||
export type FileParams = Page & File; |
||||
|
||||
/** 文件对象 */ |
||||
export interface File extends CommonEntity { |
||||
id: string; |
||||
fileName: string; |
||||
bucketName: string; |
||||
original: string; |
||||
type: string; |
||||
fileSize: number; |
||||
[key: string]: any; |
||||
} |
||||
|
||||
/** 文件响应对象 */ |
||||
export type FileResult = R<File[]>; |
Loading…
Reference in new issue