You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1017B

  1. package main
  2. func (ss *openIDSessionData) serveEvents(in InWechatMsg) (processed bool) {
  3. processed = true
  4. e := in.body.(EventMsg)
  5. switch e.Event {
  6. case "subscribe":
  7. in.replyText("/::D, 来啦")
  8. onSubscribe(in)
  9. return
  10. case "unsubscribe":
  11. in.replyText("")
  12. onUnSubscribe(in)
  13. return
  14. case "scancode_waitmsg":
  15. in.replyText("scancode_waitmsg/" + e.EventKey)
  16. case "SCAN":
  17. in.replyText("SCAN/" + e.EventKey)
  18. case "LOCATION":
  19. in.replyText("LOCATION")
  20. case "CLICK":
  21. in.replyText("CLICK/" + e.EventKey)
  22. case "VIEW":
  23. in.replyText("CLICK" + e.EventKey)
  24. case "TEMPLATESENDJOBFINISH":
  25. // <xml><ToUserName><![CDATA[gh_f09231355c68]]></ToUserName>
  26. // <FromUserName><![CDATA[oUN420Wj78vnkNeAJY7RMPXA28oc]]></FromUserName>
  27. // <CreateTime>1499150186</CreateTime>
  28. // <MsgType><![CDATA[event]]></MsgType>
  29. // <Event><![CDATA[TEMPLATESENDJOBFINISH]]></Event>
  30. // <MsgID>414001772</MsgID>
  31. // <Status><![CDATA[success]]></Status>
  32. // </xml>
  33. //in.replyText("TEMPLATESENDJOBFINISH")
  34. }
  35. return
  36. }