modal

package
v0.0.0-...-8062269 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MessageCollectionName = "message"

MessageCollectionName 消息表定义

View Source
const RoomCollectionName = "message"

RoomCollectionName 消息表定义

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Id            string      `json:"id" bson:"_id"` // 消息ID
	UserId        string      //消息发送者
	ObjectUserId  string      //消息发送对象
	RoomId        string      //消息发送房间
	Type          MessageType //消息类型
	Keys          []string    //发送标签
	Body          string      //消息内容
	Violation     bool        //违规消息
	ViolationTime time.Time   //违规消息设置时间
	Del           bool        //删除消息
	DelTime       time.Time   //消息删除时间
	Send          bool        //消息是否已经发送
	SendTime      time.Time   // 消息发送时间
	Read          bool        //消息是否已读
	ReadTime      time.Time   //消息发送时间
}

Message 消息

func (*Message) FindByBroadcast

func (msg *Message) FindByBroadcast(database *mongo.Database) (results []Message)

FindByBroadcast 获取广播消息

func (*Message) FindByKeys

func (msg *Message) FindByKeys(database *mongo.Database) (results []Message)

FindByKeys 根据用户获取消息

func (*Message) FindByRomeId

func (msg *Message) FindByRomeId(database *mongo.Database) (results []Message)

FindByRomeId 根据房间获取消息

func (*Message) FindByUserId

func (msg *Message) FindByUserId(database *mongo.Database) (results []Message)

FindByUserId 根据用户获取消息

func (*Message) Insert

func (msg *Message) Insert(database *mongo.Database) primitive.ObjectID

Insert 插入消息

func (*Message) SetDel

func (msg *Message) SetDel(database *mongo.Database)

SetDel 设置为已删除

func (*Message) SetRead

func (msg *Message) SetRead(database *mongo.Database)

SetRead 设置为已读

func (*Message) SetSend

func (msg *Message) SetSend(database *mongo.Database)

SetSend 设置为已经发送

func (*Message) SetViolation

func (msg *Message) SetViolation(database *mongo.Database)

SetViolation 设置为违规消息

type MessageType

type MessageType int32
const (
	BroadcastMessage MessageType = 0 // 广播消息
	RoomMessage      MessageType = 1 // 房间消息
	UserMessage      MessageType = 2 // 用户消息
	KeyMessage       MessageType = 3 // Key消息
)

消息类型

type Room

type Room struct {
	Icon            string     //房间图标
	Name            string     //房间名称
	Type            string     //房间类型
	User            []RoomUser //房间用户
	Dissolution     bool       //房间是否解散
	LeadUserId      string     //房间管理者
	DissolutionTime time.Time  //房间解散时间
	CreateTime      time.Time  //创建时间
	UpdateTime      time.Time  //更新时间
}

RoomUser 房间

func (*Room) Insert

func (msg *Room) Insert(database *mongo.Database) primitive.ObjectID

Insert 插入消息

type RoomUser

type RoomUser struct {
	UserId   string    //用户ID
	NickName string    //用户昵称
	Top      bool      //房间是否置顶
	Join     bool      //是否加入房间
	JoinTime time.Time //加入房间时间
	OutTime  time.Time //离开房间时间
}

RoomUser 房间用户

type User

type User struct {
	Code       string       //好友编号
	Tag        []string     //用户标签
	Name       string       //好友名称
	Phone      string       //好友手机号码
	Icon       string       //好友头像
	Del        bool         //是否删除
	Friends    []UserFriend //好友名单
	Frozen     bool         //冻结好友
	FrozenTime time.Time    //冻结时间
	CreateTime time.Time    //创建时间
	UpdateTime time.Time    //修改时间
}

User is 用户信息

type UserFriend

type UserFriend struct {
	UserId      string    //好友编号
	NickName    string    //好友备注
	Tag         []string  //好友标签
	Top         bool      //是否置顶
	Remove      bool      //是否移除
	Silence     bool      //是否浸没
	SilenceTime bool      //浸没时间
	JoinTime    time.Time //加入时间
	RemoveTime  time.Time //移除时间
}

UserFriend is 用户好友

Jump to

Keyboard shortcuts

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