-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
92 lines (81 loc) · 1.88 KB
/
models.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package db
import (
"time"
"github.com/google/uuid"
)
type Organization struct {
BaseModelSoftDelete
Name string `gorm:"type:varchar(255)"`
Description string
Type string `gorm:"type:varchar(255)"`
Wallets []Wallet
Assets []Asset
Members []Member
Keys []AccessKey
}
type AccessKey struct {
BaseModelSoftDelete
OrganizationID uuid.UUID
Name string `gorm:"type:varchar(255)"`
Token []byte `gorm:"type:binary(60)"`
ExpireAt time.Time
}
type Asset struct {
BaseModelSoftDelete
OrganizationID uuid.UUID
AccessKeyID uuid.UUID
Name string `gorm:"type:varchar(255)"`
Description string
Type string `gorm:"type:varchar(255)"`
EventCaps []EventCapability
ImageURL string
Disabled bool
}
type EventCapability struct {
BaseModelSoftDelete
AssetID uuid.UUID
Code int64
Name string `gorm:"type:varchar(255)"`
Description string
}
type Member struct {
BaseModelSoftDelete
OrganizationID uuid.UUID
User User
UserID uuid.UUID
Disabled bool
Roles string
}
type Session struct {
BaseModelSoftDelete
Active bool
User User
Asset Asset
UserID uuid.UUID
AssetID uuid.UUID
}
type User struct {
BaseModelSoftDelete
Name string `gorm:"type:varchar(255)"`
FirstName string `gorm:"type:varchar(255)"`
LastName string `gorm:"type:varchar(255)"`
NickName string `gorm:"type:varchar(255)"`
Email string `gorm:"type:varchar(255)"`
AvatarURL string
Description string
UserID string `sql:"index"`
Members []Member
Wallet *Wallet
WalletID *uuid.UUID
LoginAt *time.Time
ConfirmedAt *time.Time
VerifiedAt *time.Time
InvitedAt *time.Time
}
type Wallet struct {
BaseModelSoftDelete
OrganizationID uuid.UUID
UserID uuid.UUID
Organization Organization
EthAddress string
}