message

package
v0.0.0-...-4ecf1ed Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogoutMsgType 退出消息
	LogoutMsgType int64 = -1

	// LoginMsgType 登录消息
	LoginMsgType int64 = 1

	// PersonalDialMsgType 个人对话消息
	PersonalDialMsgType int64 = 2

	// FeedbackMsgType 反馈消息
	FeedbackMsgType int64 = 20

	// ErrorStatus 错误状态
	ErrorStatus int64 = 500

	// SuccessStatus 正常状态
	SuccessStatus int64 = 200

	// UnreadStatus 未读状态
	UnreadStatus int64 = 10

	// DBName 消息库名称
	DBName = "msg_db"

	// TableName 消息表名称
	TableName = "msg"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversation

type Conversation struct {
	ID       string    `json:"id,omitempty" db:"id"`
	UID      string    `json:"uid,omitempty" db:"uid"`
	ToID     string    `json:"toId,omitempty" db:"to_id"`
	ChatId   string    `json:"chatId,omitempty" db:"chat_id"`
	ChatType int64     `json:"chatType,omitempty" db:"chat_type"`
	Unread   int64     `json:"unread,omitempty" db:"unread"`
	IsDelete int64     `json:"isDelete,omitempty" db:"is_delete"`
	LastTime time.Time `json:"lastTime,omitempty" db:"last_time"`
}

Conversation 会话实体

type DefaultMessageService

type DefaultMessageService struct {
}

DefaultMessageService 默认消息服务实现

func (*DefaultMessageService) Save

func (svc *DefaultMessageService) Save(msg *Msg) (*Msg, error)

type Msg

type Msg struct {
	ID          string    `json:"id,omitempty" bson:"_id,omitempty"`
	Content     string    `json:"content,omitempty" bson:"content,omitempty"`
	ContentType int64     `json:"contentType,omitempty" bson:"contentType,omitempty"`
	MsgType     int64     `json:"msgType,omitempty" bson:"msgType,omitempty"`
	FromID      string    `json:"fromId,omitempty" bson:"fromId,omitempty"`
	ToID        string    `json:"toId,omitempty" bson:"toId,omitempty"`
	Status      int64     `json:"status,omitempty" bson:"status,omitempty"`
	CreateTime  time.Time `json:"createTime,omitempty" bson:"createTime,omitempty"`
}

Msg 消息实体

type Service

type Service interface {
	// Save 保存
	Save(msg *Msg) (*Msg, error)
}

Service 消息服务接口

Jump to

Keyboard shortcuts

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