Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
42061aee3c
2 changed files with 25 additions and 0 deletions
  1. +11
    -0
      tik_tok/api.go
  2. +14
    -0
      tik_tok/svc_tik_tok_open_api.go

+ 11
- 0
tik_tok/api.go View File

@@ -79,3 +79,14 @@ func OpenSendApi(method string, params map[string]interface{}, acctoken string)
data, err := zhios_third_party_utils.CurlPost(url, paramStr, headers) data, err := zhios_third_party_utils.CurlPost(url, paramStr, headers)
return string(data), err 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 View File

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

//获取用户数据
func OpenKolUserInfo(args map[string]string) (string, error) { func OpenKolUserInfo(args map[string]string) (string, error) {
fmt.Println(args) fmt.Println(args)
params := map[string]string{"open_id": args["open_id"]} params := map[string]string{"open_id": args["open_id"]}
@@ -165,3 +167,15 @@ func OpenKolUserInfo(args map[string]string) (string, error) {
fmt.Println(err) fmt.Println(err)
return send, 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
}

Loading…
Cancel
Save