alist/internal/model/setting.go
j2rong4cn 87caaf2459
Some checks are pending
auto_lang / auto generate lang.json (1.21, ubuntu-latest) (push) Waiting to run
build / Build (1.21, ubuntu-latest) (push) Waiting to run
build_docker / Build Docker (push) Waiting to run
build_docker / Build docker with aria2 (push) Blocked by required conditions
fix: out of order when database is not sqlite3 (#6560)
2024-08-03 13:11:09 +08:00

38 lines
1.0 KiB
Go

package model
const (
SINGLE = iota
SITE
STYLE
PREVIEW
GLOBAL
OFFLINE_DOWNLOAD
INDEX
SSO
LDAP
S3
)
const (
PUBLIC = iota
PRIVATE
READONLY
DEPRECATED
)
type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
Value string `json:"value"` // value
PreDefault string `json:"-" gorm:"-:all"` // deprecated value
Help string `json:"help"` // help message
Type string `json:"type"` // string, number, bool, select
Options string `json:"options"` // values for select
Group int `json:"group"` // use to group setting in frontend
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc.
Index uint `json:"index"`
}
func (s SettingItem) IsDeprecated() bool {
return s.Flag == DEPRECATED
}