websocket?

This commit is contained in:
2026-01-22 10:47:02 +00:00
parent 02d70ee5db
commit eaba9c8069
5 changed files with 108 additions and 8 deletions

View File

@@ -26,3 +26,12 @@ type Post struct {
Author *User `gorm:"foreignKey:AuthorID" json:"author"`
Content string `json:"content"`
}
type Message struct {
ID uint `gorm:"primarykey" json:"id"`
Content string `json:"text"`
AuthorID uint `json:"-"`
Author *User `gorm:"foreignKey:AuthorID" json:"author"`
CreatedAt time.Time `json:"createdAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
}