浏览代码

抖音穿山甲

master
huangjiajun 9 个月前
父节点
当前提交
7be4d377d6
共有 1 个文件被更改,包括 16 次插入2 次删除
  1. +16
    -2
      csjplatform/keyword.go

+ 16
- 2
csjplatform/keyword.go 查看文件

@@ -1,13 +1,15 @@
package csjplatform

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/tik_tok"
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"fmt"
"github.com/tidwall/gjson"
"strings"
)

//抖口令解析+二次转链接口
func Keyword(args map[string]string) (string, error) {
func Keyword(args map[string]string) tik_tok.TikTokGoods {
params := map[string]interface{}{
"command": args["command"],
}
@@ -25,5 +27,17 @@ func Keyword(args map[string]string) (string, error) {
send, err := Send(args["app_id"], args["app_secret"], "command_parse", params)
fmt.Println(send)
fmt.Println(err)
return send, err
var goodsList = tik_tok.TikTokGoods{}
ActivityId := gjson.Get(send, "data.command_info.activity_info.material_id").Int()
if ActivityId > 0 {
goodsList.ActivityId = zhios_third_party_utils.Int64ToStr(gjson.Get(send, "data.command_info.activity_info.material_id").Int())
return goodsList
}
product := gjson.Get(send, "data.command_info.product_info").String()
if err != nil || product == "" {
return goodsList
}
args["product_ids"] = gjson.Get(product, "product_id").String()
goodsList = GoodsDetail(args)
return goodsList
}

正在加载...
取消
保存