|
@@ -18,3 +18,72 @@ type ArticleCategory struct{
|
18
|
18
|
func (ArticleCategory) TableName() string {
|
19
|
19
|
return "sgj_patient_articles_menu"
|
20
|
20
|
}
|
|
21
|
+
|
|
22
|
+type Articles struct {
|
|
23
|
+ ID int64 `gorm:"column:id" json:"id"`
|
|
24
|
+ Title string `gorm:"column:title" json:"title"`
|
|
25
|
+ Summary string `gorm:"column:summary" json:"summary"`
|
|
26
|
+ Content string `gorm:"column:content" json:"content"`
|
|
27
|
+ Type int `gorm:"column:type" json:"type"`
|
|
28
|
+ Num int `gorm:"column:num" json:"num"`
|
|
29
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime"`
|
|
30
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime"`
|
|
31
|
+ ClassId int64 `gorm:"column:class_id" json:"class_id"`
|
|
32
|
+ Author string `gorm:"column:author" json:"author"`
|
|
33
|
+ Status int `gorm:"column:status" json:"status"`
|
|
34
|
+ Reason string `gorm:"column:reason" json:"reason"`
|
|
35
|
+ StarNum int `gorm:"column:star_num" json:"star_num"`
|
|
36
|
+ CommentNum int `gorm:"column:comment_num" json:"comment_num"`
|
|
37
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"`
|
|
38
|
+ ArticleStatus int64 `gorm:"column:article_status" json:"article_status"`
|
|
39
|
+ Imgs string `gorm:"column:imgs" json:"imgs"`
|
|
40
|
+ VideoUrl string `gorm:"column:video_url" json:"video_url"`
|
|
41
|
+ Cover string `gorm:"-" json:"cover"`
|
|
42
|
+ PublicTime string `gorm:"-" json:"publicTime"`
|
|
43
|
+ Comments []Comment `gorm:"ForeignKey:ArticleId"`
|
|
44
|
+ ArticleId int64 `gorm:"-"`
|
|
45
|
+}
|
|
46
|
+
|
|
47
|
+func (Articles) TableName() string {
|
|
48
|
+ return "sgj_patient_articles"
|
|
49
|
+}
|
|
50
|
+
|
|
51
|
+type Comment struct {
|
|
52
|
+ ID int64 `gorm:"column:id" json:"id"`
|
|
53
|
+ ArticleId int64 `gorm:"column:article_id" json:"article_id"`
|
|
54
|
+ CommentUserId int64 `gorm:"column:comment_user_id" json:"comment_user_id"`
|
|
55
|
+ ParentId int64 `gorm:"column:parent_id" json:"parent_id"`
|
|
56
|
+ Content string `gorm:"column:content" json:"content"`
|
|
57
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime"`
|
|
58
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime"`
|
|
59
|
+ Status int64 `gorm:"column:status" json:"status"`
|
|
60
|
+ StarNum int64 `gorm:"column:star_num" json:"star_num"`
|
|
61
|
+ CommentNum int64 `gorm:"column:comment_num" json:"comment_num"`
|
|
62
|
+ CommentId int64 `gorm:"column:comment_id" json:"comment_id"`
|
|
63
|
+ CommentUserName string `gorm:"column:comment_user_name" json:"comment_user_name"`
|
|
64
|
+ CommentUserAvater string `gorm:"column:comment_user_avater" json:"comment_user_avater"`
|
|
65
|
+ CommentTime string `gorm:"-" json:"commentTime"`
|
|
66
|
+ Article Articles
|
|
67
|
+ Parent Parents
|
|
68
|
+}
|
|
69
|
+
|
|
70
|
+type Parents struct {
|
|
71
|
+ ID int64 `gorm:"-" json:"id"`
|
|
72
|
+ ArticleId int64 `gorm:"-" json:"article_id"`
|
|
73
|
+ CommentUserId int64 `gorm:"-" json:"comment_user_id"`
|
|
74
|
+ ParentId int64 `gorm:"-" json:"parent_id"`
|
|
75
|
+ Content string `gorm:"-" json:"content"`
|
|
76
|
+ Ctime int64 `gorm:"-" json:"ctime"`
|
|
77
|
+ Mtime int64 `gorm:"-" json:"mtime"`
|
|
78
|
+ Status int64 `gorm:"-" json:"status"`
|
|
79
|
+ StarNum int64 `gorm:"-" json:"star_num"`
|
|
80
|
+ CommentNum int64 `gorm:"-" json:"comment_num"`
|
|
81
|
+ CommentId int64 `gorm:"-" json:"comment_id"`
|
|
82
|
+ CommentUserName string `gorm:"-" json:"comment_user_name"`
|
|
83
|
+ CommentUserAvater string `gorm:"-" json:"comment_user_avater"`
|
|
84
|
+ CommentTime string `gorm:"-" json:"commentTime"`
|
|
85
|
+}
|
|
86
|
+
|
|
87
|
+func (Comment) TableName() string {
|
|
88
|
+ return "sgj_patient_articles_comment"
|
|
89
|
+}
|