immodels

package
v0.0.0-...-10b6da0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = mon.ErrNotFound
	ErrInvalidObjectId = errors.New("invalid objectId")
)
View Source
var DefaultChatLogLimit int64 = 100

Functions

This section is empty.

Types

type ChatLog

type ChatLog struct {
	ID bson.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`

	ConversationId string             `bson:"conversation_id"`
	SendId         string             `bson:"send_id"`
	RecvId         string             `bson:"recv_id"`
	MsgFrom        int                `bson:"msg_from"`
	ChatType       constants.ChatType `bson:"chat_type"`
	MsgType        constants.MType    `bson:"msg_type"`
	MsgContent     string             `bson:"msg_content"`
	SendTime       int64              `bson:"send_time"`
	Status         int                `bson:"status"`
	Day            int                `bson:"day"`
	ReadRecords    []byte             `bson:"read_records"` // 已读记录
	// TODO: Fill your own fields
	UpdateAt time.Time `bson:"update_at,omitempty" json:"update_at,omitempty"`
	CreateAt time.Time `bson:"create_at,omitempty" json:"create_at,omitempty"`
}

type ChatLogModel

type ChatLogModel interface {
	// contains filtered or unexported methods
}

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

func NewChatLogModel

func NewChatLogModel(url, db, collection string) ChatLogModel

NewChatLogModel returns a model for the mongo.

type Conversation

type Conversation struct {
	ID bson.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	// TODO: Fill your own fields
	ConversationId string             `bson:"conversation_id,omitempty"`
	ChatType       constants.ChatType `bson:"chat_type,omitempty"`
	//TargetId       string             `bson:"targetId,omitempty"`
	IsShow bool     `bson:"is_show,omitempty"`
	Total  int      `bson:"total,omitempty"`
	Seq    int64    `bson:"seq"`
	Msg    *ChatLog `bson:"msg,omitempty"`

	UpdateAt time.Time `bson:"update_at,omitempty" json:"update_at,omitempty"`
	CreateAt time.Time `bson:"create_at,omitempty" json:"create_at,omitempty"`
}

type ConversationModel

type ConversationModel interface {
	// contains filtered or unexported methods
}

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

func NewConversationModel

func NewConversationModel(url, db, collection string) ConversationModel

NewConversationModel returns a model for the mongo.

type Conversations

type Conversations struct {
	ID bson.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`

	// TODO: Fill your own fields
	UserId           string                   `bson:"user_id" json:"user_id"`
	ConversationList map[string]*Conversation `bson:"conversation_list,omitempty" json:"conversation_list,omitempty"`

	UpdateAt time.Time `bson:"update_at,omitempty" json:"update_at,omitempty"`
	CreateAt time.Time `bson:"create_at,omitempty" json:"create_at,omitempty"`
}

type ConversationsModel

type ConversationsModel interface {
	// contains filtered or unexported methods
}

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

func NewConversationsModel

func NewConversationsModel(url, db, collection string) ConversationsModel

NewConversationsModel returns a model for the mongo.

Jump to

Keyboard shortcuts

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