12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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
- }
- func (*Session) TableName() string {
- return "tb_session"
- }
- func (*SessionMember) TableName() string {
- return "tb_session_member"
- }
- func (*SessionMessage) TableName() string {
- return "tb_session_message"
- }
|