-
Notifications
You must be signed in to change notification settings - Fork 0
/
oversea.go
84 lines (71 loc) · 2.2 KB
/
oversea.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
package oversea
import (
"go-common/library/time"
)
const (
StateOK = 1
StateDeleted = 0
)
type ArchiveRelation struct {
ID int64 `json:"id" gorm:"column:id"`
GroupID int64 `json:"policy_id" gorm:"column:policy_id"`
Aid int64 `json:"aid" gorm:"column:aid"`
}
func (ArchiveRelation) TableName() string {
return "archive_relation"
}
type PolicyGroup struct {
ID int64 `json:"id" gorm:"column:id"`
IsGlobal int8 `json:"is_global" gorm:"column:is_global"`
Aid int64 `json:"aid" gorm:"column:aid"`
Name string `json:"name" gorm:"column:name"`
Type int8 `json:"type" gorm:"column:type"`
State int8 `json:"state" gorm:"column:state"`
UserName string `json:"username" gorm:"-"`
UID int64 `json:"uid" gorm:"column:uid"`
Remark string `json:"remark" gorm:"column:remark;size:140"`
CTime time.Time `json:"ctime" gorm:"column:ctime"`
MTime time.Time `json:"mtime" gorm:"column:mtime"`
Items []*PolicyItem `json:"items" gorm:"-"`
}
func (PolicyGroup) TableName() string {
return "policy_group"
}
type PolicyGroupData struct {
Items []*PolicyGroup `json:"items"`
Pager *Pager `json:"pager"`
}
type Pager struct {
Num int64 `json:"num"`
Size int64 `json:"size"`
Total int64 `json:"total"`
}
type PolicyItem struct {
ID int64 `json:"id" gorm:"column:id"`
GroupID int64 `json:"group_id" gorm:"column:group_id"`
PlayAuth int8 `json:"play_auth" gorm:"column:play_auth"`
DownAuth int8 `json:"down_auth" gorm:"column:down_auth"`
AreaID string `json:"area_id" gorm:"column:area_id"`
ZoneID string `json:"zone_id" gorm:"column:zone_id"`
State int8 `json:"state" gorm:"column:state"`
}
func (PolicyItem) TableName() string {
return "policy_item"
}
type PolicyParams struct {
ID int64 `json:"id"`
DownAuth int8 `json:"down_auth"`
PlayAuth int8 `json:"play_auth"`
AreaIds []int64 `json:"area_id"`
}
type Zone struct {
ID int64 `json:"id"`
Name string `json:"name"`
Pid int64 `json:"pid"`
Ppid int64 `json:"ppid"`
ZoneID int64 `json:"zone_id"`
Status int8 `json:"status"`
}
func (Zone) TableName() string {
return "locality"
}