@ -0,0 +1,11 @@ | |||||
package weixinrpc | |||||
import ( | |||||
"testing" | |||||
) | |||||
func Test_GetAccessToken(t *testing.T) { | |||||
ret, err := GetAccessToken("test", "100005", "wx303b0cec4a8d1bc1", "90ddb8da4bc4e96e600532dd24be8c7b") | |||||
t.Log(ret, err) | |||||
} |
@ -0,0 +1,10 @@ | |||||
module git.tetele.net/tgo/weixinrpc | |||||
go 1.14 | |||||
require ( | |||||
git.tetele.net/tgo/crypter v0.2.2 // indirect | |||||
github.com/chai2010/protorpc v1.0.0 // indirect | |||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect | |||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect | |||||
) |
@ -0,0 +1,17 @@ | |||||
git.tetele.net/tgo/crypter v0.2.2 h1:YMQJh2Gj5Po4ZfelJUmXBKi01UbmtiSy3bmqRfnYQMo= | |||||
git.tetele.net/tgo/crypter v0.2.2/go.mod h1:vfvRLZA8+lHNgNXneOcgvVhDyuv25ZRb+C6xHOmXNx0= | |||||
github.com/chai2010/protorpc v1.0.0 h1:aJ45G9sl1utSKo35EqnBSTs5jqTpdJDJAuZMMYPAtFo= | |||||
github.com/chai2010/protorpc v1.0.0/go.mod h1:woR3WwjaQDqFjlzdVsFEKiK5Ur12QL8mYxVPjfr5z54= | |||||
github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ= | |||||
github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | |||||
github.com/golang/snappy v0.0.0-20170215233205-553a64147049 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk= | |||||
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= | |||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= | |||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= | |||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | |||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= | |||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | |||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | |||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | |||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= |
@ -0,0 +1,33 @@ | |||||
package weixinrpc | |||||
import ( | |||||
"encoding/json" | |||||
"testing" | |||||
) | |||||
func Test_SendUniformMessage(t *testing.T) { | |||||
db := "gkxy_tetele_net" | |||||
site_id := "1101832" | |||||
appid := "wx7be627d0325135f4" | |||||
secret := "984c6d213c60419c4f30c159fbbe1ce9" | |||||
touser := "osxVD5S0PAh82gyIXSiXCJzM_k6s" | |||||
mp_appid := "wx056995d61ca222f5" | |||||
temp_id := "6xgj_65KivigMvwdJgiveR4wLXJLDpzsT2-hShczLmU" | |||||
url := "" | |||||
mini_program := "wx7be627d0325135f4" | |||||
data := map[string]map[string]string{ | |||||
"first": map[string]string{"value": "来新订单了"}, | |||||
"keyword1": map[string]string{"value": "订单号是。。。"}, | |||||
"keyword2": map[string]string{"value": "取货位置"}, | |||||
"keyword3": map[string]string{"value": "收货人"}, | |||||
"keyword4": map[string]string{"value": "联系电话"}, | |||||
"keyword5": map[string]string{"value": "收货地址"}, | |||||
"remark": map[string]string{"value": "这是备注"}, | |||||
} | |||||
data_json, _ := json.Marshal(data) | |||||
ret, err := SendUniformMessage(db, site_id, appid, secret, touser, mp_appid, temp_id, url, mini_program, data) | |||||
t.Log(ret, err) | |||||
} |