message.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. ProcessInstanceId string `json:"processInstanceId"`
  23. CorpId string `json:"corpId"`
  24. CreateTime string `json:"createTime"`
  25. FinishTime string `json:"finishTime"`
  26. Title string `json:"title"`
  27. ProcessType string `json:"type"`
  28. StaffId string `json:"staffId"`
  29. Url string `json:"url"`
  30. Result string `json:"result"`
  31. ProcessCode string `json:"processCode"`
  32. }
  33. //Reply 消息回复
  34. type Reply struct {
  35. MsgSignature string `json:"msg_signature"`
  36. TimeStamp string `json:"timeStamp"`
  37. Nonce string `json:"nonce"`
  38. Encrypt string `json:"encrypt"`
  39. }