-
Notifications
You must be signed in to change notification settings - Fork 44
/
model.go
82 lines (74 loc) · 2.52 KB
/
model.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
package data
import (
"gorm.io/gorm"
"time"
)
type CommentDraft struct {
gorm.Model
Uuid string `gorm:"index;size:36"`
Status int32 `gorm:"default:1"`
}
type Comment struct {
CommentId int32 `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
CreationId int32 `gorm:"index:creation"`
CreationType int32 `gorm:"index:creation"`
CreationAuthor string `gorm:"index;size:36"`
Uuid string `gorm:"index;size:36"`
Agree int32 `gorm:"index;type:int unsigned;default:0"`
Comment int32 `gorm:"type:int unsigned;default:0"`
}
type CommentAgree struct {
gorm.Model
CommentId int32 `gorm:"uniqueIndex:idx_unique"`
Uuid string `gorm:"uniqueIndex:idx_unique;size:36"`
Status int32 `gorm:"default:1"`
}
type SubComment struct {
CommentId int32 `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
CreationId int32 `gorm:"index:creation"`
CreationType int32 `gorm:"index:creation"`
CreationAuthor string `gorm:"size:36"`
RootId int32 `gorm:"index"`
RootUser string `gorm:"index;size:36"`
ParentId int32 `gorm:"index"`
Uuid string `gorm:"index;size:36"`
Reply string `gorm:"index;size:36"`
Agree int32 `gorm:"type:int unsigned;default:0"`
}
type CommentUser struct {
CreatedAt time.Time
UpdatedAt time.Time
Uuid string `gorm:"primarykey;size:36"`
Comment int32 `gorm:"type:int unsigned;default:0"`
ArticleReply int32 `gorm:"type:int unsigned;default:0"`
ArticleReplySub int32 `gorm:"type:int unsigned;default:0"`
TalkReply int32 `gorm:"type:int unsigned;default:0"`
TalkReplySub int32 `gorm:"type:int unsigned;default:0"`
ArticleReplied int32 `gorm:"type:int unsigned;default:0"`
ArticleRepliedSub int32 `gorm:"type:int unsigned;default:0"`
TalkReplied int32 `gorm:"type:int unsigned;default:0"`
TalkRepliedSub int32 `gorm:"type:int unsigned;default:0"`
}
type CommentContentReview struct {
gorm.Model
CommentId int32
Comment string
Kind string
Uuid string `gorm:"index;size:36"`
JobId string `gorm:"size:100"`
Label string `gorm:"size:100"`
Result int32
Section string
}
type Record struct {
gorm.Model
Uuid string `gorm:"size:36"`
CommonId int32
Ip string
}