message.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package message
  2. import "context"
  3. // EventType 事件类型
  4. type EventType string
  5. const (
  6. //EventCheckUrl 验证URL
  7. EventCheckUrl EventType = "check_url"
  8. //EventSubscribe 订阅
  9. EventSubscribe = "subscribe"
  10. //EventUnsubscribe 取消订阅
  11. EventUnsubscribe = "unsubscribe"
  12. )
  13. // SubsMessage 订阅消息
  14. type SubsMessage struct {
  15. Ctx context.Context
  16. Encrypt string `json:"encrypt"`
  17. }
  18. //MixMessage 存放所有钉钉发送过来的消息和事件
  19. type MixMessage struct {
  20. EventType EventType `json:"EventType"`
  21. // 日程相关
  22. // 审批通知
  23. ProcessInstanceId string `json:"processInstanceId"`
  24. CorpId string `json:"corpId"`
  25. CreateTime string `json:"createTime"`
  26. FinishTime string `json:"finishTime"`
  27. Title string `json:"title"`
  28. ProcessType string `json:"type"`
  29. StaffId string `json:"staffId"`
  30. Url string `json:"url"`
  31. Result string `json:"result"`
  32. ProcessCode string `json:"processCode"`
  33. }
  34. //Reply 消息回复
  35. type Reply struct {
  36. MsgSignature string `json:"msg_signature"`
  37. TimeStamp string `json:"timeStamp"`
  38. Nonce string `json:"nonce"`
  39. Encrypt string `json:"encrypt"`
  40. }