-
Notifications
You must be signed in to change notification settings - Fork 13
/
settings_entity.go
49 lines (44 loc) · 1.5 KB
/
settings_entity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package entity
import (
"github.com/latolukasz/beeorm"
)
const (
SettingsValueTypeText = "text"
SettingsValueTypeNumber = "number"
SettingsValueTypeEmail = "email"
SettingsValueTypeTel = "tel"
SettingsValueTypeURI = "uri"
SettingsValueTypePassword = "password"
SettingsValueTypeDateTime = "datetime"
SettingsValueTypeJSON = "json"
)
type settingsValueType struct {
SettingsValueTypeText string
SettingsValueTypeNumber string
SettingsValueTypeEmail string
SettingsValueTypeTel string
SettingsValueTypeURI string
SettingsValueTypePassword string
SettingsValueTypeDateTime string
SettingsValueTypeJSON string
}
var SettingsValueTypeAll = settingsValueType{
SettingsValueTypeText: SettingsValueTypeText,
SettingsValueTypeNumber: SettingsValueTypeNumber,
SettingsValueTypeEmail: SettingsValueTypeEmail,
SettingsValueTypeTel: SettingsValueTypeTel,
SettingsValueTypeURI: SettingsValueTypeURI,
SettingsValueTypePassword: SettingsValueTypePassword,
SettingsValueTypeDateTime: SettingsValueTypeDateTime,
SettingsValueTypeJSON: SettingsValueTypeJSON,
}
type SettingsEntity struct {
beeorm.ORM `orm:"table=settings;redisCache;redisSearch=search_pool;"`
ID uint64 `orm:"sortable"`
Key string `orm:"required;unique=Settings_Key;sortable;searchable;"`
Value string `orm:"required;length=max;"`
ValueType string `orm:"enum=entity.SettingsValueTypeAll"`
Editable bool
Deletable bool
Hidden bool `orm:"searchable"`
}