1234567891011121314151617181920212223 |
- package models
- import (
- "strings"
- "time"
- )
- // SessionSingle 一对一会话表
- type SessionSingle struct {
- ID string `gorm:"column:id;primary_key"`
- TargetUserID string `gorm:"column:target_user_id;NOT NULL"`
- ToUserID string `gorm:"column:to_user_id;NOT NULL"`
- CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP;NOT NULL"`
- UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;NOT NULL"`
- }
- func (m *SessionSingle) TableName() string {
- return "tb_session_single"
- }
- func IsSessionSingle(id string) bool {
- return strings.Contains(id, "SINGLE_")
- }
|