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