Documentation ¶
Index ¶
- Constants
- type Message
- func (msg *Message) FindByBroadcast(database *mongo.Database) (results []Message)
- func (msg *Message) FindByKeys(database *mongo.Database) (results []Message)
- func (msg *Message) FindByRomeId(database *mongo.Database) (results []Message)
- func (msg *Message) FindByUserId(database *mongo.Database) (results []Message)
- func (msg *Message) Insert(database *mongo.Database) primitive.ObjectID
- func (msg *Message) SetDel(database *mongo.Database)
- func (msg *Message) SetRead(database *mongo.Database)
- func (msg *Message) SetSend(database *mongo.Database)
- func (msg *Message) SetViolation(database *mongo.Database)
- type MessageType
- type Room
- type RoomUser
- type User
- type UserFriend
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 ¶
FindByBroadcast 获取广播消息
func (*Message) FindByKeys ¶
FindByKeys 根据用户获取消息
func (*Message) FindByRomeId ¶
FindByRomeId 根据房间获取消息
func (*Message) FindByUserId ¶
FindByUserId 根据用户获取消息
func (*Message) SetViolation ¶
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 房间
type RoomUser ¶
type RoomUser struct { UserId string //用户ID NickName string //用户昵称 Top bool //房间是否置顶 Join bool //是否加入房间 JoinTime time.Time //加入房间时间 OutTime time.Time //离开房间时间 }
RoomUser 房间用户
Click to show internal directories.
Click to hide internal directories.