123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- 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:"-"`
- //}
- type Articles struct {
- ID int64 `gorm:"column:id" json:"id" form:"id"`
- Title string `gorm:"column:title" json:"title" form:"title"`
- Summary string `gorm:"column:summary" json:"summary" form:"summary"`
- Content string `gorm:"column:content" json:"content" form:"content"`
- Type int64 `gorm:"column:type" json:"type" form:"type"`
- Num int64 `gorm:"column:num" json:"num" form:"num"`
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
- RealReadNum int64 `gorm:"column:real_read_num" json:"real_read_num" form:"real_read_num"`
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
- ClassId int64 `gorm:"column:class_id" json:"class_id" form:"class_id"`
- Author string `gorm:"column:author" json:"author" form:"author"`
- Status int64 `gorm:"column:status" json:"status" form:"status"`
- Reason string `gorm:"column:reason" json:"reason" form:"reason"`
- StarNum int64 `gorm:"column:star_num" json:"star_num" form:"star_num"`
- CommentNum int64 `gorm:"column:comment_num" json:"comment_num" form:"comment_num"`
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
- ArticleStatus int64 `gorm:"column:article_status" json:"article_status" form:"article_status"`
- Imgs string `gorm:"column:imgs" json:"imgs" form:"imgs"`
- VideoUrl string `gorm:"column:video_url" json:"video_url" form:"video_url"`
- Source int64 `gorm:"column:source" json:"source" form:"source"`
- CategoryId int64 `gorm:"column:category_id" json:"category_id" form:"category_id"`
- Ttid int64 `gorm:"column:ttid" json:"ttid" form:"ttid"`
- Ttype int64 `gorm:"column:ttype" json:"ttype" form:"ttype"`
- Toid int64 `gorm:"column:toid" json:"toid" form:"toid"`
- Comments []Comment `gorm:"ForeignKey:ArticleId"`
- PublicTime string `gorm:"-" json:"publicTime"`
- 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:"column:id" json:"id" form:"id"`
- ArticleId int64 `gorm:"column:article_id" json:"article_id" form:"article_id"`
- CommentUserId int64 `gorm:"column:comment_user_id" json:"comment_user_id" form:"comment_user_id"`
- ParentId int64 `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
- Content string `gorm:"column:content" json:"content" form:"content"`
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
- Status int64 `gorm:"column:status" json:"status" form:"status"`
- StarNum int64 `gorm:"column:star_num" json:"star_num" form:"star_num"`
- CommentNum int64 `gorm:"column:comment_num" json:"comment_num" form:"comment_num"`
- CommentId int64 `gorm:"column:comment_id" json:"comment_id" form:"comment_id"`
- CommentUserName string `gorm:"column:comment_user_name" json:"comment_user_name" form:"comment_user_name"`
- CommentUserAvater string `gorm:"column:comment_user_avater" json:"comment_user_avater" form:"comment_user_avater"`
- Source int64 `gorm:"column:source" json:"source" form:"source"`
- Ttid int64 `gorm:"column:ttid" json:"ttid" form:"ttid"`
- TuserId int64 `gorm:"column:tuser_id" json:"tuser_id" form:"tuser_id"`
- Taid int64 `gorm:"column:taid" json:"taid" form:"taid"`
- Tpid int64 `gorm:"column:tpid" json:"tpid" form:"tpid"`
- Tcid int64 `gorm:"column:tcid" json:"tcid" form:"tcid"`
- }
-
- func (Comment) TableName() string {
- return "sgj_patient_articles_comment"
- }
|