feat: initial setting items

This commit is contained in:
Noah Hsu
2022-06-27 15:51:02 +08:00
parent e4c3ef0262
commit 1a148eee7c
11 changed files with 136 additions and 17 deletions

View File

@ -1,5 +1,19 @@
package model
const (
SITE = iota
STYLE
PREVIEW
GLOBAL
)
const (
PUBLIC = iota
PRIVATE
READONLY
DEPRECATED
)
type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
Value string `json:"value"` // value
@ -7,5 +21,5 @@ type SettingItem struct {
Type string `json:"type"` // string, number, bool, select
Values string `json:"values"` // values for select
Group int `json:"group"` // use to group setting in frontend
Access int `json:"access"` // admin/guest/general
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = deprecated, etc.
}