💚 change build platform

This commit is contained in:
微凉
2021-11-04 13:23:17 +08:00
parent a7ecb7beb8
commit bfec01e837
8 changed files with 100 additions and 99 deletions

View File

@ -7,7 +7,7 @@ import (
type Account struct {
Name string `json:"name" gorm:"primaryKey" validate:"required"`
Index int `json:"index" validate:"required"`
Index int `json:"index"`
Type string `json:"type"`
Username string `json:"username"`
Password string `json:"password"`
@ -28,8 +28,8 @@ type Account struct {
Zone string `json:"zone"`
RedirectUri string `json:"redirect_uri"`
SiteUrl string `json:"site_url"`
SiteId string
OnedriveType string `json:"onedrive_type"`
SiteId string `json:"site_id"`
OnedriveType string `json:"onedrive_type"`
}
var accountsMap = map[string]Account{}

View File

@ -14,7 +14,7 @@ type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" validate:"required"`
Value string `json:"value"`
Description string `json:"description"`
Type string `json:"type"`
//Type string `json:"type"`
Group int `json:"group"`
}
@ -22,6 +22,10 @@ func SaveSettings(items []SettingItem) error {
return conf.DB.Save(items).Error
}
func SaveSetting(item SettingItem) error {
return conf.DB.Save(item).Error
}
func GetSettingsPublic() (*[]SettingItem, error) {
var items []SettingItem
if err := conf.DB.Where("`group` <> ?", 1).Find(&items).Error; err != nil {