微信接口的RPC包
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.

33 lines
1.0 KiB

  1. package weixinrpc
  2. import (
  3. "encoding/json"
  4. "testing"
  5. )
  6. func Test_SendUniformMessage(t *testing.T) {
  7. db := "gkxy_tetele_net"
  8. site_id := "1101832"
  9. appid := "wx7be627d0325135f4"
  10. secret := "984c6d213c60419c4f30c159fbbe1ce9"
  11. touser := "osxVD5S0PAh82gyIXSiXCJzM_k6s"
  12. mp_appid := "wx056995d61ca222f5"
  13. temp_id := "6xgj_65KivigMvwdJgiveR4wLXJLDpzsT2-hShczLmU"
  14. url := ""
  15. mini_program := "wx7be627d0325135f4"
  16. data := map[string]map[string]string{
  17. "first": map[string]string{"value": "来新订单了"},
  18. "keyword1": map[string]string{"value": "订单号是。。。"},
  19. "keyword2": map[string]string{"value": "取货位置"},
  20. "keyword3": map[string]string{"value": "收货人"},
  21. "keyword4": map[string]string{"value": "联系电话"},
  22. "keyword5": map[string]string{"value": "收货地址"},
  23. "remark": map[string]string{"value": "这是备注"},
  24. }
  25. data_json, _ := json.Marshal(data)
  26. ret, err := SendUniformMessage(db, site_id, appid, secret, touser, mp_appid, temp_id, url, mini_program, data)
  27. t.Log(ret, err)
  28. }