imConversations

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMapByIds

func GetMapByIds(ids []uint64) map[uint64]*Entity

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

func UpdateLastMsg

func UpdateLastMsg(id uint64, content string)

Types

type Entity

type Entity struct {
	Id             uint64    `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`                                    // 主键
	Type           int       `gorm:"column:type;type:tinyint(1);not null;default:1;" json:"type"`                               // 1 单聊 (C2C)
	LastMsgContent string    `gorm:"column:last_msg_content;type:varchar(255);default:'';" json:"lastMsgContent"`               // 最后一条消息预览
	LastMsgTime    time.Time `gorm:"column:last_msg_time;type:datetime;not null;default:CURRENT_TIMESTAMP;" json:"lastMsgTime"` // 用于排序
	CreatedAt      time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"`                        //
}

func Get

func Get(id any) (entity Entity)

func GetByIds

func GetByIds(ids []uint64) (entities []*Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL