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
|
2022-06-29 09:31:37 +00:00
|
|
|
ARIA2
|
2022-12-05 08:45:11 +00:00
|
|
|
INDEX
|
2022-12-27 14:11:22 +00:00
|
|
|
GITHUB
|
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 {
|
2022-08-26 07:08:31 +00:00
|
|
|
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
|
|
|
|
Value string `json:"value"` // 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.
|
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
|
|
|
}
|