package models import ( "encoding/json" "time" "gorm.io/gorm" ) type Session struct { ID string `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` // Name string MembersCount int Type string CreatedBy string } type SessionMember struct { ID string `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` SessionId string RefId string RefType string AccountIdentity string JoinTime time.Time } type SessionMessage struct { ID string `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Receiver string Sender string SessionId string PayloadType uint8 Payload json.RawMessage `gorm:"type:json"` IsRead int SentAt time.Time } func (*Session) TableName() string { return "tb_session" } func (*SessionMember) TableName() string { return "tb_session_member" } func (*SessionMessage) TableName() string { return "tb_session_message" }