feat: update storage schema (#1142)

This commit is contained in:
boojack
2023-02-24 00:02:51 +08:00
committed by GitHub
parent 84fb8b2288
commit 9c5b44d070
9 changed files with 271 additions and 229 deletions

View File

@ -1,8 +1,16 @@
package api
type Storage struct {
ID int `json:"id"`
Name string `json:"name"`
type StorageType string
const (
StorageS3 StorageType = "S3"
)
type StorageConfig struct {
S3Config *StorageS3Config `json:"s3Config"`
}
type StorageS3Config struct {
EndPoint string `json:"endPoint"`
Region string `json:"region"`
AccessKey string `json:"accessKey"`
@ -11,30 +19,28 @@ type Storage struct {
URLPrefix string `json:"urlPrefix"`
}
type Storage struct {
ID int `json:"id"`
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StorageCreate struct {
Name string `json:"name"`
EndPoint string `json:"endPoint"`
Region string `json:"region"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
Bucket string `json:"bucket"`
URLPrefix string `json:"urlPrefix"`
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StoragePatch struct {
ID int `json:"id"`
Name *string `json:"name"`
EndPoint *string `json:"endPoint"`
Region *string `json:"region"`
AccessKey *string `json:"accessKey"`
SecretKey *string `json:"secretKey"`
Bucket *string `json:"bucket"`
URLPrefix *string `json:"urlPrefix"`
ID int `json:"id"`
Type StorageType `json:"type"`
Name *string `json:"name"`
Config *StorageConfig `json:"config"`
}
type StorageFind struct {
ID *int `json:"id"`
Name *string `json:"name"`
ID *int `json:"id"`
}
type StorageDelete struct {