feat: rbac完善,file接入完成
This commit is contained in:
+83
-1
@@ -28,10 +28,67 @@ type (
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
Name string `json:"name,optional"`
|
||||
}
|
||||
FileListResp {
|
||||
List []FileInfo `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
// 文件ID请求
|
||||
FileIdReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
// ---------- 存储配置 ----------
|
||||
StorageConfigInfo {
|
||||
Id string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
BucketName string `json:"bucketName"`
|
||||
BucketUrl string `json:"bucketUrl"`
|
||||
Region string `json:"region"`
|
||||
IsDefault int `json:"isDefault"`
|
||||
Status int `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
CreateStorageConfigReq {
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
BucketName string `json:"bucketName"`
|
||||
BucketUrl string `json:"bucketUrl"`
|
||||
Region string `json:"region,optional"`
|
||||
Status int `json:"status,optional"`
|
||||
Remark string `json:"remark,optional"`
|
||||
}
|
||||
UpdateStorageConfigReq {
|
||||
Id string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
BucketName string `json:"bucketName"`
|
||||
BucketUrl string `json:"bucketUrl"`
|
||||
Region string `json:"region,optional"`
|
||||
Status int `json:"status,optional"`
|
||||
Remark string `json:"remark,optional"`
|
||||
}
|
||||
SetDefaultStorageConfigReq {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
StorageConfigListReq {
|
||||
Current int `json:"current,optional"`
|
||||
PageSize int `json:"pageSize,optional"`
|
||||
Type string `json:"type,optional"`
|
||||
Name string `json:"name,optional"`
|
||||
}
|
||||
StorageConfigListResp {
|
||||
List []StorageConfigInfo `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
)
|
||||
|
||||
// ========== 需要鉴权的接口 ==========
|
||||
@@ -51,10 +108,35 @@ service file-api {
|
||||
|
||||
@doc "文件列表"
|
||||
@handler GetFileList
|
||||
post /list (FileListReq)
|
||||
post /list (FileListReq) returns (FileListResp)
|
||||
|
||||
@doc "获取文件信息"
|
||||
@handler GetFileById
|
||||
get /:id (FileIdReq) returns (FileInfo)
|
||||
|
||||
@doc "下载文件"
|
||||
@handler DownloadFile
|
||||
get /download/:id (FileIdReq)
|
||||
|
||||
// ---------- 存储配置管理 ----------
|
||||
@doc "创建存储配置"
|
||||
@handler CreateStorageConfig
|
||||
post /config/create (CreateStorageConfigReq)
|
||||
|
||||
@doc "更新存储配置"
|
||||
@handler UpdateStorageConfig
|
||||
post /config/update (UpdateStorageConfigReq)
|
||||
|
||||
@doc "删除存储配置"
|
||||
@handler DeleteStorageConfig
|
||||
post /config/delete (IdsReq)
|
||||
|
||||
@doc "设置默认存储配置"
|
||||
@handler SetDefaultStorageConfig
|
||||
post /config/setDefault (SetDefaultStorageConfigReq)
|
||||
|
||||
@doc "获取存储配置列表"
|
||||
@handler GetStorageConfigList
|
||||
post /config/list (StorageConfigListReq) returns (StorageConfigListResp)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user