package models type ArticleCategory struct{ //对应数据库中的字段 IMenuId int64 `gorm:"column:id" json:"id" form:"id"` Name string `gorm:"column:name" json:"name" form:"Name"` Order int64 `gorm:"column:order" json:"order" form:"order"` Status int64 `gorm:"column:status" json:"status" form:"status"` Summary string `gorm:"column:summary" json:"summary" form:"summary"` Type int64 `gorm:"column:type" json:"type" form:"type"` UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"` Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"` Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"` Num int64 `gorm:"column:num" json:"num" form:"num"` } func (ArticleCategory) TableName() string { return "sgj_patient_articles_menu" } type Articles struct { ID int64 `gorm:"column:id" json:"id"` Title string `gorm:"column:title" json:"title"` Summary string `gorm:"column:summary" json:"summary"` Content string `gorm:"column:content" json:"content"` Type int `gorm:"column:type" json:"type"` Num int `gorm:"column:num" json:"num"` Realreadnum int64 `gorm:"column:real_read_num" json:"real_read_num"` Mtime int64 `gorm:"column:mtime" json:"mtime"` Ctime int64 `gorm:"column:ctime" json:"ctime"` ClassId int64 `gorm:"column:class_id" json:"class_id"` Author string `gorm:"column:author" json:"author"` Status int `gorm:"column:status" json:"status"` Reason string `gorm:"column:reason" json:"reason"` StarNum int `gorm:"column:star_num" json:"star_num"` CommentNum int `gorm:"column:comment_num" json:"comment_num"` UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id"` ArticleStatus int64 `gorm:"column:article_status" json:"article_status"` Imgs string `gorm:"column:imgs" json:"imgs"` VideoUrl string `gorm:"column:video_url" json:"video_url"` Cover string `gorm:"-" json:"cover"` PublicTime string `gorm:"-" json:"publicTime"` Comments []Comment `gorm:"ForeignKey:ArticleId"` ArticleId int64 `gorm:"-"` } func (Articles) TableName() string { return "sgj_patient_articles" } type Comment struct { ID int64 `gorm:"column:id" json:"id"` ArticleId int64 `gorm:"column:article_id" json:"article_id"` CommentUserId int64 `gorm:"column:comment_user_id" json:"comment_user_id"` ParentId int64 `gorm:"column:parent_id" json:"parent_id"` Content string `gorm:"column:content" json:"content"` Ctime int64 `gorm:"column:ctime" json:"ctime"` Mtime int64 `gorm:"column:mtime" json:"mtime"` Status int64 `gorm:"column:status" json:"status"` StarNum int64 `gorm:"column:star_num" json:"star_num"` CommentNum int64 `gorm:"column:comment_num" json:"comment_num"` CommentId int64 `gorm:"column:comment_id" json:"comment_id"` CommentUserName string `gorm:"column:comment_user_name" json:"comment_user_name"` CommentUserAvater string `gorm:"column:comment_user_avater" json:"comment_user_avater"` CommentTime string `gorm:"-" json:"commentTime"` Article Articles Parent Parents } type Parents struct { ID int64 `gorm:"-" json:"id"` ArticleId int64 `gorm:"-" json:"article_id"` CommentUserId int64 `gorm:"-" json:"comment_user_id"` ParentId int64 `gorm:"-" json:"parent_id"` Content string `gorm:"-" json:"content"` Ctime int64 `gorm:"-" json:"ctime"` Mtime int64 `gorm:"-" json:"mtime"` Status int64 `gorm:"-" json:"status"` StarNum int64 `gorm:"-" json:"star_num"` CommentNum int64 `gorm:"-" json:"comment_num"` CommentId int64 `gorm:"-" json:"comment_id"` CommentUserName string `gorm:"-" json:"comment_user_name"` CommentUserAvater string `gorm:"-" json:"comment_user_avater"` CommentTime string `gorm:"-" json:"commentTime"` } func (Comment) TableName() string { return "sgj_patient_articles_comment" }