|
|
@@ -0,0 +1,65 @@ |
|
|
|
package tik_tok |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"github.com/tidwall/gjson" |
|
|
|
) |
|
|
|
|
|
|
|
func Activity(args map[string]string) []TikTokActivity { |
|
|
|
//args = map[string]string{ |
|
|
|
// "appkey": "7136155008692651560", |
|
|
|
// "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", |
|
|
|
// "status": "5", |
|
|
|
// "search_type": "0", |
|
|
|
// "sort_type": "1", |
|
|
|
// "page": "1", |
|
|
|
// "page_size": "20", |
|
|
|
// "acctoken": "21af5cb7-6a14-455f-90f7-6807b5e6655f", |
|
|
|
//} |
|
|
|
params := map[string]interface{}{"status": args["status"], "search_type": args["search_type"], "sort_type": args["sort_type"], "page": args["page"], "page_size": args["page_size"]} |
|
|
|
send, err := Send(args["appkey"], args["appSecret"], "alliance.instituteColonelActivityList", params, args["acctoken"]) |
|
|
|
var goodsList = make([]TikTokActivity, 0) |
|
|
|
if err != nil { |
|
|
|
return goodsList |
|
|
|
} |
|
|
|
product := gjson.Get(send, "data.activity_list").String() |
|
|
|
if err != nil || product == "" { |
|
|
|
return goodsList |
|
|
|
} |
|
|
|
err = json.Unmarshal([]byte(product), &goodsList) |
|
|
|
if err != nil { |
|
|
|
return goodsList |
|
|
|
} |
|
|
|
return goodsList |
|
|
|
|
|
|
|
} |
|
|
|
func ActivityProduct(args map[string]string) { |
|
|
|
//args = map[string]string{ |
|
|
|
// "appkey": "7136155008692651560", |
|
|
|
// "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", |
|
|
|
// "activity_id": "349895", |
|
|
|
// "search_type": "0", |
|
|
|
// "sort_type": "1", |
|
|
|
// "page": "1", |
|
|
|
// "count": "20", |
|
|
|
// "acctoken": "21af5cb7-6a14-455f-90f7-6807b5e6655f", |
|
|
|
//} |
|
|
|
params := map[string]interface{}{"activity_id": args["activity_id"], "search_type": args["search_type"], "sort_type": args["sort_type"], "page": args["page"], "count": args["count"]} |
|
|
|
send, err := Send(args["appkey"], args["appSecret"], "alliance.colonelActivityProduct", params, args["acctoken"]) |
|
|
|
fmt.Println(send) |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
func ProductUrl(args map[string]string) { |
|
|
|
//args = map[string]string{ |
|
|
|
// "appkey": "7136155008692651560", |
|
|
|
// "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", |
|
|
|
// "product_url": "https://haohuo.jinritemai.com/views/product/detail?id=3566782589740130047&ins_activity_param=jXxRyGL&pick_source=jc2e3jF", |
|
|
|
// "pick_extra": "123", |
|
|
|
// "acctoken": "21af5cb7-6a14-455f-90f7-6807b5e6655f", |
|
|
|
//} |
|
|
|
params := map[string]interface{}{"product_url": args["product_url"], "pick_extra": args["pick_extra"]} |
|
|
|
send, err := Send(args["appkey"], args["appSecret"], "buyin.instPickSourceConvert", params, args["acctoken"]) |
|
|
|
fmt.Println(send) |
|
|
|
fmt.Println(err) |
|
|
|
} |