package models import ( "time" "github.com/google/uuid" ) // #[derive(Debug, Clone, FromRow, Serialize, Deserialize)] //pub struct Message { // pub id: Uuid, // pub channel_id: Uuid, // pub user_id: Uuid, // pub content: String, // pub created_at: DateTime, // pub edited_at: DateTime, // pub reply_to_id: Option, //} type Message struct { ID uuid.UUID `gorm:"primaryKey" json:"id"` ChannelID uuid.UUID `gorm:"index" json:"channel_id"` UserID uuid.UUID `gorm:"index" json:"user_id"` Content string `gorm:"not null" json:"content"` CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"` EditedAt *time.Time `gorm:"default:null" json:"edited_at,omitempty"` ReplyToID *uuid.UUID `gorm:"index" json:"reply_to_id,omitempty"` }