message.go 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package event
  2. // TextMessage 文本消息
  3. type TextMessage struct {
  4. AuthorizerEvent
  5. Content CDATA `xml:"Content"`
  6. MsgID int64 `xml:"MsgId"`
  7. // BizMsgMenuID 发送客服文本消息的时候用户的响应
  8. BizMsgMenuID int `xml:"bizmsgmenuid"`
  9. }
  10. // TextReplyMessage 回复文本消息
  11. type TextReplyMessage struct {
  12. AuthorizerEvent
  13. Content CDATA `xml:"Content"`
  14. }
  15. // ImageMessage 图片消息
  16. type ImageMessage struct {
  17. AuthorizerEvent
  18. PicURL CDATA `xml:"PicUrl"`
  19. MediaID CDATA `xml:"MediaId"`
  20. MsgID int64 `xml:"MsgId"`
  21. }
  22. // ImageReplyMessage 回复图片消息
  23. type ImageReplyMessage struct {
  24. AuthorizerEvent
  25. MediaID CDATA `xml:"Image>MediaId"`
  26. }
  27. // VoiceMessage 语音消息
  28. type VoiceMessage struct {
  29. AuthorizerEvent
  30. MediaID CDATA `xml:"MediaId"`
  31. Format CDATA `xml:"Format"`
  32. Recognition CDATA `xml:"Recognition"`
  33. MsgID int64 `xml:"MsgId"`
  34. }
  35. // VoiceReplyMessage 回复语音消息
  36. type VoiceReplyMessage struct {
  37. AuthorizerEvent
  38. MediaID CDATA `xml:"Voice>MediaId"`
  39. }
  40. // VideoMessage 视频消息
  41. type VideoMessage struct {
  42. AuthorizerEvent
  43. MediaID CDATA `xml:"MediaId"`
  44. ThumbMediaID CDATA `xml:"ThumbMediaId"`
  45. MsgID int64 `xml:"MsgId"`
  46. }
  47. // VideoReplyMessage 回复视频消息
  48. type VideoReplyMessage struct {
  49. AuthorizerEvent
  50. MediaID CDATA `xml:"Video>MediaId"`
  51. Title CDATA `xml:"Video>Title"`
  52. Description CDATA `xml:"Video>Description"`
  53. }
  54. // MusicReplyMessage 回复音乐消息
  55. type MusicReplyMessage struct {
  56. AuthorizerEvent
  57. Title CDATA `xml:"Music>Title"`
  58. Description CDATA `xml:"Video>Description"`
  59. MusicURL CDATA `xml:"Video>MusicUrl"`
  60. HQMusicURL CDATA `xml:"Video>HQMusicUrl"`
  61. ThumbMediaID CDATA `xml:"Video>ThumbMediaId"`
  62. }
  63. // ShortVideoMessage 小视频消息
  64. type ShortVideoMessage struct {
  65. AuthorizerEvent
  66. MediaID CDATA `xml:"MediaId"`
  67. ThumbMediaID CDATA `xml:"ThumbMediaId"`
  68. MsgID int64 `xml:"MsgId"`
  69. }
  70. // LocationMessage 地理位置消息
  71. type LocationMessage struct {
  72. AuthorizerEvent
  73. LocationX float64 `xml:"Location_X"`
  74. LocationY float64 `xml:"Location_Y"`
  75. Scale int `xml:"Scale"`
  76. Label CDATA `xml:"Label"`
  77. MsgID int64 `xml:"MsgId"`
  78. }
  79. // LinkMessage 链接消息
  80. type LinkMessage struct {
  81. AuthorizerEvent
  82. Title CDATA `xml:"Title"`
  83. Description CDATA `xml:"Description"`
  84. URL CDATA `xml:"Url"`
  85. MsgID int64 `xml:"MsgId"`
  86. }
  87. // ItemMessage 回复图文消息的单独一个item
  88. type ItemMessage struct {
  89. Title CDATA `xml:"Title"`
  90. Description CDATA `xml:"Description"`
  91. PicURL CDATA `xml:"PicUrl"`
  92. URL CDATA `xml:"Url"`
  93. }
  94. // NewsReplyMessage 回复图文消息
  95. type NewsReplyMessage struct {
  96. AuthorizerEvent
  97. ArticleCount int `xml:"ArticleCount"`
  98. Articles []ItemMessage `xml:"Articles>item"`
  99. }