huangjiajun 1 rok temu
rodzic
commit
3481cffc49
1 zmienionych plików z 34 dodań i 0 usunięć
  1. +34
    -0
      zero_buy/api.go

+ 34
- 0
zero_buy/api.go Wyświetl plik

@@ -0,0 +1,34 @@
package zero_buy

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"
"github.com/syyongx/php2go"
"strings"
)

func ZeroBuyUrl(appSecret string, param map[string]string) string {
url := "http://114.132.183.119:8085/#/"
for k, v := range param {
if strings.Contains(url, "?") == false {
url += "?" + k + "=" + v
} else {
url += "&" + k + "=" + v
}
}
sign := GetSign(appSecret, param)
url += "&sign=" + sign
return url
}
func GetSign(appSecret string, param map[string]string) string {
keys := comm.KsortToStr(param)
str := ""
for _, k := range keys {
if str == "" {
str += k + "=" + param[k]
} else {
str += "|" + k + "=" + param[k]
}
}
str += "|" + appSecret
return php2go.Md5(str)
}

Ładowanie…
Anuluj
Zapisz