Browse Source

add reverse:for v1.0.3 更新

tags/v1.0.3
huangjiajun 2 years ago
parent
commit
e14e32ecc7
4 changed files with 89 additions and 2 deletions
  1. +7
    -0
      tik_tok/md_tik_tok_activity.go
  2. +16
    -1
      tik_tok/svc_tik_tok_convert.go
  3. +65
    -0
      tik_tok/svc_tik_tok_team.go
  4. +1
    -1
      tik_tok/tik_tok_test.go

+ 7
- 0
tik_tok/md_tik_tok_activity.go View File

@@ -0,0 +1,7 @@
package tik_tok

type TikTokActivity struct {
ActivityId string `json:"activity_id"`
ActivityName string `json:"activity_name"`
ActivityEndTime string `json:"activity_end_time"`
}

+ 16
- 1
tik_tok/svc_tik_tok_convert.go View File

@@ -20,7 +20,6 @@ func GoodsCreatePid(args map[string]string) map[string]string {
return data
}
func GoodsConvertUrl(args map[string]string) map[string]string {

params := map[string]interface{}{"pid": args["pid"], "external_info": args["external_info"], "product_url": args["product_url"]}
send, err := Send(args["appkey"], args["appSecret"], "buyin.kolProductShare", params, args["acctoken"])
fmt.Println(send)
@@ -61,3 +60,19 @@ func LiveConvertUrl(args map[string]string) map[string]string {

return data
}

func RegimentalConvertUrl(args map[string]string) map[string]string {

params := map[string]interface{}{"pid_info": map[string]interface{}{"pid": args["pid"], "external_info": args["external_info"]}, "open_id": args["open_id"]}
send, err := Send(args["appkey"], args["appSecret"], "buyin.instituteLiveShare", params, args["acctoken"])
fmt.Println(send)
var data = map[string]string{}
if err != nil {
return data
}
data["deeplink"] = gjson.Get(send, "data.dy_deeplink").String()
data["content"] = php2go.Base64Encode(gjson.Get(send, "data.dy_password").String())
data["qr_code"] = gjson.Get(send, "data.qr_code.url").String()

return data
}

+ 65
- 0
tik_tok/svc_tik_tok_team.go View File

@@ -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)
}

+ 1
- 1
tik_tok/tik_tok_test.go View File

@@ -5,5 +5,5 @@ import (
)

func TestGoods(t *testing.T) {
GoodsOrder(map[string]string{})
Activity(map[string]string{})
}

Loading…
Cancel
Save