第三方api接口
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.

api.go 943 B

5 months ago
12345678910111213141516171819202122232425
  1. package yunyangwl_express
  2. import (
  3. zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
  4. "fmt"
  5. "github.com/syyongx/php2go"
  6. "time"
  7. )
  8. //https://open.yunyangwl.com/#/developmentDocumentation
  9. func Send(method, appid, secretKey string, params map[string]interface{}) (string, error) {
  10. timeStamp := zhios_third_party_utils.Int64ToStr(time.Now().Unix() * 1000)
  11. requestId := zhios_third_party_utils.UUIDString()
  12. params["timeStamp"] = timeStamp
  13. params["requestId"] = requestId
  14. params["appid"] = appid
  15. params["sign"] = php2go.Md5(appid + requestId + timeStamp + secretKey)
  16. params["serviceCode"] = method
  17. //url := "https://api.yunyangwl.com/api/sandbox/openService"
  18. url := "https://api.yunyangwl.com/api/wuliu/openService"
  19. post, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(params), nil)
  20. fmt.Println(string(post))
  21. fmt.Println(err)
  22. return string(post), err
  23. }