huangjiajun 1 rok temu
rodzic
commit
42061aee3c
2 zmienionych plików z 25 dodań i 0 usunięć
  1. +11
    -0
      tik_tok/api.go
  2. +14
    -0
      tik_tok/svc_tik_tok_open_api.go

+ 11
- 0
tik_tok/api.go Wyświetl plik

@@ -79,3 +79,14 @@ func OpenSendApi(method string, params map[string]interface{}, acctoken string)
data, err := zhios_third_party_utils.CurlPost(url, paramStr, headers)
return string(data), err
}
func OpenSendApiGet(method string, acctoken string) (string, error) {
url := "https://open.douyin.com/" + method
headers := map[string]string{
"Content-Type": "application/json",
}
if acctoken != "" {
headers["access-token"] = acctoken
}
data, err := zhios_third_party_utils.CurlGet(url, headers)
return string(data), err
}

+ 14
- 0
tik_tok/svc_tik_tok_open_api.go Wyświetl plik

@@ -157,6 +157,8 @@ func OpenKolStoreRemove(args map[string]interface{}) (string, error) {
fmt.Println(err)
return send, err
}

//获取用户数据
func OpenKolUserInfo(args map[string]string) (string, error) {
fmt.Println(args)
params := map[string]string{"open_id": args["open_id"]}
@@ -165,3 +167,15 @@ func OpenKolUserInfo(args map[string]string) (string, error) {
fmt.Println(err)
return send, err
}
func OpenKolUserFans(args map[string]interface{}) (string, error) {
/**
product_id int64 3450632721376902816 商品ID
promotion_id int64 3450632721374033833 推广ID
*/
url := "data/external/user/fans/?open_id=" + zhios_third_party_utils.AnyToString(args["open_id"]) + "&date_type=" + zhios_third_party_utils.AnyToString(args["date_type"])
fmt.Println(args)
send, err := OpenSendApiGet(url, zhios_third_party_utils.AnyToString(args["acctoken"]))
fmt.Println(send)
fmt.Println(err)
return send, err
}

Ładowanie…
Anuluj
Zapisz