model

package
v0.0.0-...-39337ee Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MsgSayHello string = "我们已经是好友了, 现在可以开始聊天了"
View Source
const MsgTypeAudio int64 = 4 // 音频
View Source
const MsgTypePic int64 = 2 // 图片
View Source
const MsgTypeText int64 = 1 // 文本
View Source
const MsgTypeVideo int64 = 3 // 视频
View Source
const PerPullNum int64 = 10 // 每次消息拉取的数量

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type ChatMsg

type ChatMsg struct {
	Id         int64     `db:"id"`
	GroupId    string    `db:"group_id"`
	SenderId   int64     `db:"sender_id"`
	Type       int64     `db:"type"` // 1文本, 2图片, 3视频, 4音频
	Content    string    `db:"content"`
	CreateTime time.Time `db:"create_time"`
	Uuid       string    `db:"uuid"`
}

type ChatMsgModel

type ChatMsgModel interface {
	FindMsgListByLastMsgId(ctx context.Context, groupId string, minMsgId int64, maxMsgId int64) ([]*ChatMsg, error)
	FindLastMsgByGroupId(ctx context.Context, groupId string) (*ChatMsg, error)
	// contains filtered or unexported methods
}

ChatMsgModel is an interface to be customized, add more methods here, and implement the added methods in customChatMsgModel.

func NewChatMsgModel

func NewChatMsgModel(conn sqlx.SqlConn, c cache.CacheConf) ChatMsgModel

NewChatMsgModel returns a model for the database table.

Jump to

Keyboard shortcuts

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