feat: storage service backend (#1086)

* feat: storage service backend

* update go.mod

* update the column name (urlPrefix -> url_prefix)

* update

* update
This commit is contained in:
Zeng1998
2023-02-13 19:36:48 +08:00
committed by GitHub
parent cbc3373e8e
commit 1e4a81dea9
12 changed files with 387 additions and 23 deletions

View File

@ -23,6 +23,8 @@ const (
SystemSettingAdditionalScriptName SystemSettingName = "additionalScript"
// SystemSettingCustomizedProfileName is the key type of customized server profile.
SystemSettingCustomizedProfileName SystemSettingName = "customizedProfile"
// SystemSettingStorageServiceName is the key type of sotrage service name.
SystemSettingStorageServiceName SystemSettingName = "storageServiceName"
)
// CustomizedProfile is the struct definition for SystemSettingCustomizedProfileName system setting item.
@ -55,6 +57,8 @@ func (key SystemSettingName) String() string {
return "additionalScript"
case SystemSettingCustomizedProfileName:
return "customizedProfile"
case SystemSettingStorageServiceName:
return "storageServiceName"
}
return ""
}
@ -127,6 +131,8 @@ func (upsert SystemSettingUpsert) Validate() error {
if !slices.Contains(UserSettingAppearanceValue, customizedProfile.Appearance) {
return fmt.Errorf("invalid appearance value")
}
} else if upsert.Name == SystemSettingStorageServiceName {
return nil
} else {
return fmt.Errorf("invalid system setting name")
}