From 40815e1025115aa32462f95a29bf0d336c6654e9 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 31 May 2024 17:31:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8A=96=E5=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_tikTok_team_goods/novajo.go | 44 ++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/third_tikTok_team_goods/novajo.go b/third_tikTok_team_goods/novajo.go index 2b561bc..e49deb5 100644 --- a/third_tikTok_team_goods/novajo.go +++ b/third_tikTok_team_goods/novajo.go @@ -31,6 +31,11 @@ func GetGoodsDetail(id, secret string, param map[string]interface{}) *NovajoGood json.Unmarshal([]byte(data), &list) return &list } +func GetOrder(id, secret string, param []int64) { + send, _ := SendPost("/kol/claim", id, secret, param) + fmt.Println(send) + return +} //https://dyb.novajo.cn/open/kol-api func Send(method string, id, secret string, param map[string]interface{}) (string, error) { @@ -57,8 +62,41 @@ func Send(method string, id, secret string, param map[string]interface{}) (strin } } fmt.Println(url) - json, err := zhios_third_party_utils.CurlGet(url, nil) - fmt.Println(string(json)) + json1, err := zhios_third_party_utils.CurlGet(url, nil) + fmt.Println(string(json1)) + fmt.Println(err) + return string(json1), err +} +func SendPost(method string, id, secret string, param []int64) (string, error) { + url := "https://api.novajo.cn/api" + method + now := time.Now().Unix() * 1000 + str := id + str += "" + for _, v := range param { + if strings.Contains(str, "ids=") == false { + str += "ids=" + zhios_third_party_utils.AnyToString(v) + } else { + str += "," + zhios_third_party_utils.AnyToString(v) + } + } + str += zhios_third_party_utils.Int64ToStr(now) + sign := php2go.Md5(secret + str + secret) + fmt.Println(secret + str + secret) + fmt.Println(sign) + params := make(map[string]interface{}) + params["id"] = id + params["time"] = now + params["sign"] = sign + for k, v := range params { + if strings.Contains(url, "?") == false { + url += "?" + k + "=" + zhios_third_party_utils.AnyToString(v) + } else { + url += "&" + k + "=" + zhios_third_party_utils.AnyToString(v) + } + } + fmt.Println(url) + json1, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(param), nil) + fmt.Println(string(json1)) fmt.Println(err) - return string(json), err + return string(json1), err }