-
Notifications
You must be signed in to change notification settings - Fork 9
/
structs.go
51 lines (43 loc) · 1.4 KB
/
structs.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
50
51
package model
const (
EventTypeList = "EventTypeList"
ActionTypeList = "ActionTypeList"
PropertyTypeList = "PropertyTypeList"
)
type EventType struct {
SourceID string `gorm:"primaryKey"`
Name string `gorm:"primaryKey"`
PropertyTypeList []PropertyType `gorm:"many2many:event_type_property_type;"`
}
type Event struct {
ID uint `gorm:"primaryKey"`
SourceID string `gorm:"index"`
Name string `gorm:"index"`
Properties map[string]string `gorm:"foreignKey:Id"`
Timestamp int64 `gorm:"autoCreateTime:milli"`
UUID string `json:"uuid,omitempty"`
}
type ActionType struct {
SourceID string `gorm:"primaryKey"`
Name string `gorm:"primaryKey"`
PropertyTypeList []PropertyType `gorm:"many2many:action_type_property_type;"`
}
type Action struct {
ID uint `gorm:"primaryKey"`
SourceID string `gorm:"index"`
Name string `gorm:"index"`
Properties map[string]string `gorm:"foreignKey:Id"`
Timestamp int64 `gorm:"autoCreateTime:milli"`
}
type PropertyType struct {
Name string `gorm:"primaryKey"`
}
// type Property struct {
// ID uint `gorm:"primaryKey"`
// Name string
// Value string
// }
type GenericType struct {
SourceID string `gorm:"primaryKey"`
Name string `gorm:"primaryKey"`
}