package model import "gorm.io/datatypes" // 帖子状态 const ( PostPublished = "published" PostHidden = "hidden" PostDeleted = "deleted" ) // Post 社区帖子 type Post struct { Base UserID uint `gorm:"index" json:"user_id"` PetID *uint `json:"pet_id"` AuthorName string `gorm:"size:64" json:"author_name"` AuthorEmoji string `gorm:"size:16" json:"author_emoji"` Identity string `gorm:"size:16" json:"identity"` // petName / anonymous / official Content string `gorm:"type:text" json:"content"` Tags datatypes.JSON `json:"tags"` Images datatypes.JSON `json:"images"` LikeCount int `json:"like_count"` CommentCount int `json:"comment_count"` Status string `gorm:"size:16;default:published;index" json:"status"` }