2022-06-27 06:51:48 +00:00
|
|
|
package model
|
|
|
|
|
2022-06-27 07:51:02 +00:00
|
|
|
const (
|
2022-12-05 08:45:11 +00:00
|
|
|
SINGLE = iota
|
|
|
|
SITE
|
2022-06-27 07:51:02 +00:00
|
|
|
STYLE
|
|
|
|
PREVIEW
|
|
|
|
GLOBAL
|
2023-11-06 08:56:55 +00:00
|
|
|
OFFLINE_DOWNLOAD
|
2022-12-05 08:45:11 +00:00
|
|
|
INDEX
|
2023-03-02 09:55:33 +00:00
|
|
|
SSO
|
2023-12-31 05:46:13 +00:00
|
|
|
LDAP
|
2024-03-02 07:35:10 +00:00
|
|
|
S3
|
2022-06-27 07:51:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
PUBLIC = iota
|
|
|
|
PRIVATE
|
|
|
|
READONLY
|
|
|
|
DEPRECATED
|
|
|
|
)
|
|
|
|
|
2022-06-27 06:51:48 +00:00
|
|
|
type SettingItem struct {
|
2024-03-05 08:29:26 +00:00
|
|
|
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.
|
2024-08-03 05:11:09 +00:00
|
|
|
Index uint `json:"index"`
|
2022-06-27 09:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s SettingItem) IsDeprecated() bool {
|
|
|
|
return s.Flag == DEPRECATED
|
2022-06-27 06:51:48 +00:00
|
|
|
}
|