- refactor weixinapi
This commit is contained in:
32
platformapi/weixinapi/cgibin_test.go
Normal file
32
platformapi/weixinapi/cgibin_test.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package weixinapi
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRefreshToken(t *testing.T) {
|
||||
result, err := weixinapi.CBRefreshToken()
|
||||
if err != nil || result.ExpiresIn != 7200 {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
sugarLogger.Debug(result)
|
||||
}
|
||||
|
||||
func TestCBMessageTemplateSend(t *testing.T) {
|
||||
// "oYN_usk0AeGc_C6VEZfmFQP5VHMQ": 1, // 周小扬
|
||||
// "oYN_ust9hXKEvEv0X6Mq6nlAWs_E": 1, // me
|
||||
// "oYN_usvnObzrPweIgHTad9-uMf78": 1, // 老赵
|
||||
weixinapi.CBSetToken("17_HUkrxPrmSWDb-zuV1g9ioYj_MvHST2aGZZ58iX-g5JFiiV4vFJxQS8SvNlhHNh2HtT7aQGC3Lxozw43l-1lojMVu-6nYqqW-h2SKVxwHUvfYn5BJ6vqzQ9uU-da9u4KIazdq-ImOibw-G6pENNCfAFAIIX")
|
||||
err := weixinapi.CBMessageTemplateSend("oYN_ust9hXKEvEv0X6Mq6nlAWs_E", "_DtNGwmOeR6TkkTVUblxLIlkV2MAPOX57TkvfdqG6nY", "", map[string]interface{}{
|
||||
"appid": "wx4b5930c13f8b1170",
|
||||
"pagepath": "pages/order-manager/main",
|
||||
}, map[string]interface{}{
|
||||
"first": "first",
|
||||
"Day": "Day",
|
||||
"orderId": "orderId",
|
||||
"orderType": "orderType",
|
||||
"customerName": "customerName",
|
||||
"customerPhone": "customerPhone",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user