瀏覽代碼

更新

master
huangjiajun 1 年之前
父節點
當前提交
02d8651a89
共有 3 個文件被更改,包括 48 次插入1 次删除
  1. +13
    -0
      tik_tok/md_tik_tok_goods.go
  2. +26
    -0
      tik_tok/svc_tik_tok_team.go
  3. +9
    -1
      tik_tok/tik_tok_test.go

+ 13
- 0
tik_tok/md_tik_tok_goods.go 查看文件

@@ -73,3 +73,16 @@ type TikTokLive struct {
IsLive string `json:"is_live"`
Pvd string `json:"pvd"`
}

type TikTokTeamOrder struct {
ColonelOrderInfo struct {
EstimatedCommission int64 `json:"estimated_commission"`
RealCommission int64 `json:"real_commission"`
} `json:"colonel_order_info"`
ColonelOrderInfoSecond struct {
EstimatedCommission int64 `json:"estimated_commission"`
RealCommission int64 `json:"real_commission"`
} `json:"colonel_order_info_second"`
OrderID string `json:"order_id"`
SettleTime string `json:"settle_time"`
}

+ 26
- 0
tik_tok/svc_tik_tok_team.go 查看文件

@@ -96,3 +96,29 @@ func ProductUrl(args map[string]string) map[string]string {

return data
}

func TeamOrder(args map[string]string) []TikTokTeamOrder {
params := map[string]interface{}{
"size": args["size"],
"cursor": args["cursor"],
"order_ids": args["order_ids"],
}
send, err := Send(args["appkey"], args["appSecret"], "buyin.instituteOrderColonel", params, args["acctoken"])
fmt.Println(send)
fmt.Println(err)
var goodsList = make([]TikTokTeamOrder, 0)
product := gjson.Get(send, "data").String()
if err != nil || product == "" {
return goodsList
}
var lmData struct {
Data struct {
Orders []TikTokTeamOrder `json:"orders"`
} `json:"data"`
}
err = json.Unmarshal([]byte(send), &lmData)
if err != nil {
return goodsList
}
return lmData.Data.Orders
}

+ 9
- 1
tik_tok/tik_tok_test.go 查看文件

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

func TestGoods(t *testing.T) {
ActivityProduct(map[string]string{})
args := map[string]string{
"cursor": "0",
"size": "20",
"order_ids": "5017095963287082709",
"acctoken": "12620ec1-e018-461b-8b04-3074d79cd6f6",
"appkey": "7136155008692651560",
"appSecret": "b132549f-f62c-491e-86f1-89af3658896a",
}
TeamOrder(args)
}

Loading…
取消
儲存