message.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package types
  2. type (
  3. Msg struct {
  4. MType `mapstructure:"mType"`
  5. Content string `mapstructure:"content"` //内容
  6. MsgID string `mapstructure:"msgId"` // 消息id
  7. ReadRecords map[string]string `mapstructure:"readRecords"` // 阅读消息记录
  8. }
  9. Chat struct {
  10. ConversationId string `mapstructure:"conversationId"` // 会话id
  11. ChatType `mapstructure:"chatType"` // 会话类型
  12. SendID int64 `mapstructure:"sendId"` //发送者
  13. RecvID int64 `mapstructure:"recvId"` //接收者
  14. Msg `mapstructure:"msg"` // 消息接口
  15. SendTime int64 `mapstructure:"sendTime"` // 消息发送时间
  16. }
  17. Push struct {
  18. ConversationId string `mapstructure:"conversationId"` // 会话id
  19. ChatType `mapstructure:"chatType"` // 会话类型
  20. SendID int64 `mapstructure:"sendId"` //发送者
  21. RecvID int64 `mapstructure:"recvId"` //接收者
  22. RecvIDs []int64 `mapstructure:"recvIds"` //多个接收者
  23. SendTime int64 `mapstructure:"sendTime"` //消息发送时间
  24. MsgID string `mapstructure:"msgId"` // 消息id
  25. ReadRecords map[string]string `mapstructure:"readRecords"` //消息阅读记录
  26. ContentType ContentType `mapstructure:"contentType"` // 消息内容类型
  27. MType `mapstructure:"mType"`
  28. Content string `mapstructure:"content"` // 消息内容
  29. ID string `json:"id"` // 消息id
  30. }
  31. MarkRead struct {
  32. ChatType `mapstructure:"chatType"`
  33. RecvID int64 `mapstructure:"recvId"` //接收者
  34. ConversationId string `mapstructure:"conversationId"`
  35. MsgIds []string `mapstructure:"msgIds"`
  36. }
  37. )