| "cmtWK2teRnLOXyO5dw7lJkETv9jCeNAqYyguEu5D8gG", | "cmtWK2teRnLOXyO5dw7lJkETv9jCeNAqYyguEu5D8gG", | ||||
| "wx876e233fde456b7b", | "wx876e233fde456b7b", | ||||
| "4a91aa328569b10a9fb97adeb8b0af58", | "4a91aa328569b10a9fb97adeb8b0af58", | ||||
| "wechat_hitxy_access_token"} | |||||
| "wechat_hitxy_access_token", | |||||
| "gh_f09231355c68"} | |||||
| } | } | ||||
| func AssertEqual(t *testing.T, a interface{}, b interface{}, message string) { | func AssertEqual(t *testing.T, a interface{}, b interface{}, message string) { |
| //AuthTokenSaveTo | //AuthTokenSaveTo | ||||
| AuthTokenSaveTo string `json:"AuthTokenSaveTo"` | AuthTokenSaveTo string `json:"AuthTokenSaveTo"` | ||||
| //PublicAccountID | |||||
| PublicAccountID string `json:"PublicAccountID"` | |||||
| } | } | ||||
| //APIConfig contains secrets that cannot store in source file | //APIConfig contains secrets that cannot store in source file |
| <MsgType><![CDATA[text]]></MsgType> | <MsgType><![CDATA[text]]></MsgType> | ||||
| <Content><![CDATA[%s]]></Content> | <Content><![CDATA[%s]]></Content> | ||||
| </xml>` | </xml>` | ||||
| msg := fmt.Sprintf(template, ToUserName, "gh_f09231355c68", int32(time.Now().Unix()), txt) | |||||
| fmt.Println(msg) | |||||
| msg := fmt.Sprintf(template, ToUserName, APIConfig.PublicAccountID, int32(time.Now().Unix()), txt) | |||||
| e := Encode(msg) | e := Encode(msg) | ||||
| str, _, _, _ := signMsg(e) | str, _, _, _ := signMsg(e) | ||||
| fmt.Println(str) | |||||
| return str, nil | return str, nil | ||||
| } | } | ||||
| "EncodingAESKey": "cmtWK2teRnLOXyO5dw7lJkETv9jCeNAqYyguEu5D8gG", | "EncodingAESKey": "cmtWK2teRnLOXyO5dw7lJkETv9jCeNAqYyguEu5D8gG", | ||||
| "Appid": "wx876e233fde456b7b", | "Appid": "wx876e233fde456b7b", | ||||
| "AppSecret": "4a91aa328569b10a9fb97adeb8b0af58", | "AppSecret": "4a91aa328569b10a9fb97adeb8b0af58", | ||||
| "AuthTokenSaveTo": "/tmp/wechat_hitxy_token" | |||||
| "AuthTokenSaveTo": "/tmp/wechat_hitxy_token", | |||||
| "PublicAccountID":"gh_f09231355c68" | |||||
| } | } |