feat: 新增存储管理

This commit is contained in:
2024-04-10 22:13:25 +08:00
parent 3533e020c6
commit 8142f07ce7
6 changed files with 381 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
export * from './dept'
export * from './log'
export * from './storage'

View File

@@ -0,0 +1,29 @@
import http from '@/utils/http'
import type * as System from './type'
const BASE_URL = '/system/storage'
/** @desc 查询存储列表 */
export function listStorage(query: System.StorageQuery) {
return http.get<PageRes<System.StorageResp[]>>(`${BASE_URL}`, query)
}
/** @desc 查询存储详情 */
export function getStorage(id: string) {
return http.get<System.StorageResp>(`${BASE_URL}/${id}`)
}
/** @desc 新增存储 */
export function addStorage(data: any) {
return http.post(`${BASE_URL}`, data)
}
/** @desc 修改存储 */
export function updateStorage(data: any, id: string) {
return http.put(`${BASE_URL}/${id}`, data)
}
/** @desc 删除存储 */
export function deleteStorage(id: string) {
return http.del(`${BASE_URL}/${id}`)
}

View File

@@ -52,3 +52,28 @@ export interface LogQuery extends PageQuery {
createTime?: string
status?: number
}
/** 系统存储类型 */
export type StorageResp = {
id: string
name: string
code: string
type: number
accessKey: string
secretKey: string
endpoint: string
bucketName: string
domain: string
description: string
isDefault: boolean
sort: number
status: number
createUserString: string
createTime: string
updateUserString: string
updateTime: string
}
export interface StorageQuery extends PageQuery {
description?: string
status?: number
}