1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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"`
- SessionId string
- Receiver string
- Sender string
- Type int8
- ContentType uint8
- Content json.RawMessage `gorm:"type:json"`
- IsRead BitBool
- Received BitBool
- 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"
- }
|