| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package types
- import "time"
- type FrameType uint8
- const (
- FrameData FrameType = 0x0
- FramePing FrameType = 0x1
- FrameErr FrameType = 0x9
- FrameAck FrameType = 0x2
- FrameNoAck FrameType = 0x3
- )
- type (
- Msg struct {
- MType `mapstructure:"mType"`
- Content string `mapstructure:"content"` //内容
- MsgID string `mapstructure:"msgId"` // 消息id
- ReadRecords map[string]string `mapstructure:"readRecords"` // 阅读消息记录
- }
- Chat struct {
- ConversationId string `mapstructure:"conversationId"` // 会话id
- ChatType `mapstructure:"chatType"` // 会话类型
- SendID int64 `mapstructure:"sendId"` //发送者
- RecvID int64 `mapstructure:"recvId"` //接收者
- Msg `mapstructure:"msg"` // 消息接口
- SendTime int64 `mapstructure:"sendTime"` // 消息发送时间
- }
- Push struct {
- ConversationId string `mapstructure:"conversationId"` // 会话id
- ChatType `mapstructure:"chatType"` // 会话类型
- SendID int64 `mapstructure:"sendId"` //发送者
- RecvID int64 `mapstructure:"recvId"` //接收者
- RecvIDs []int64 `mapstructure:"recvIds"` //多个接收者
- SendTime int64 `mapstructure:"sendTime"` //消息发送时间
- MsgID string `mapstructure:"msgId"` // 消息id
- ReadRecords map[string]string `mapstructure:"readRecords"` //消息阅读记录
- ContentType ContentType `mapstructure:"contentType"` // 消息内容类型
- MType `mapstructure:"mType"`
- Content string `mapstructure:"content"` // 消息内容
- ID string `json:"id"` // 消息id
- }
- MarkRead struct {
- ChatType `mapstructure:"chatType"`
- RecvID int64 `mapstructure:"recvId"` //接收者
- ConversationId string `mapstructure:"conversationId"`
- MsgIds []string `mapstructure:"msgIds"`
- }
- MessagePushData struct {
- FrameType `json:"frame_type"` //消息类型
- Id string `json:"id"`
- AckSeq int `json:"ack_seq"` // ack seq
- AckTime time.Time `json:"ackTime"` // ack时间
- AccErrCount int `json:"errCount"` // ack失败次数
- Method string `json:"method,omitempty"` // 消息处理方法
- FormID int64 `json:"form_id,omitempty"` // 接收者id
- UserID int64 `json:"user_id,omitempty"` // 发送者id
- Data interface{} `json:"data,omitempty"` // 消息内容
- }
- )
|