diff --git a/tik_tok/api.go b/tik_tok/api.go index c99d297..4c96438 100644 --- a/tik_tok/api.go +++ b/tik_tok/api.go @@ -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 +} diff --git a/tik_tok/svc_tik_tok_open_api.go b/tik_tok/svc_tik_tok_open_api.go index 0ef29a1..13b46fe 100644 --- a/tik_tok/svc_tik_tok_open_api.go +++ b/tik_tok/svc_tik_tok_open_api.go @@ -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 +}