structure.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package wechat
  2. import "encoding/xml"
  3. // FormSignature signature
  4. type FormSignature struct {
  5. TimeStamp string `form:"timestamp" json:"timestamp"`
  6. Nonce string `form:"nonce" json:"nonce"`
  7. Signature string `form:"signature" json:"signature"`
  8. Echostr string `form:"echostr" json:"echostr"`
  9. }
  10. // ResponseMsg response
  11. type ResponseMsg struct {
  12. ErrCode int `json:"errcode"`
  13. ErrMsg string `json:"errmsg"`
  14. }
  15. // Response response
  16. type Response struct {
  17. ErrCode int `json:"errcode"`
  18. ErrMsg string `json:"errmsg"`
  19. // token
  20. AccessToken string `json:"access_token"`
  21. ExpiresIn int `json:"expires_in"`
  22. // openid
  23. RefreshToken string `json:"refresh_token"`
  24. OpenID string `json:"openid"`
  25. Scope string `json:"scope"`
  26. // user info
  27. NickName string `json:"nickname"`
  28. Sex string `json:"sex"`
  29. Province string `json:"province"`
  30. City string `json:"city"`
  31. Country string `json:"country"`
  32. HeadImgURL string `json:"headimgurl"`
  33. Privilege string `json:"privilege"`
  34. UnionID string `json:"unionid"`
  35. // template message
  36. MsgID int64 `json:"msgid"`
  37. // jsapi_ticket
  38. Ticket string `json:"ticket"`
  39. }
  40. // Message message
  41. type Message struct {
  42. XMLName xml.Name `xml:"xml"`
  43. ToUserName string `xml:"ToUserName" json:"ToUserName"`
  44. FromUserName string `xml:"FromUserName" json:"FromUserName"`
  45. CreateTime int32 `xml:"CreateTime" json:"CreateTime"`
  46. MsgType string `xml:"MsgType" json:"MsgType"`
  47. MsgID int64 `xml:"MsgId" json:"MsgId"`
  48. }
  49. // EventTemplateReply event reply
  50. type EventTemplateReply struct {
  51. XMLName xml.Name `xml:"xml"`
  52. ToUserName string `xml:"ToUserName"`
  53. FromUserName string `xml:"FromUserName"`
  54. CreateTime string `xml:"CreateTime"`
  55. MsgType string `xml:"MsgType"`
  56. Event string `xml:"Event"`
  57. MsgID string `xml:"MsgID"`
  58. Status string `xml:"Status"`
  59. }