第三方api接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
947 B

  1. package tik_tok
  2. import (
  3. "fmt"
  4. "github.com/syyongx/php2go"
  5. "github.com/tidwall/gjson"
  6. )
  7. func CsjpActivity(args map[string]string) (map[string]string, string) {
  8. params := map[string]interface{}{
  9. "external_info": args["external_info"],
  10. "material_id": args["material_id"],
  11. }
  12. if args["extra_params"] != "" {
  13. params["extra_params"] = args["extra_params"]
  14. }
  15. send, err := CsjpSend(args["app_id"], args["app_secret"], "aggregate/h5", params)
  16. var data = map[string]string{}
  17. if err != nil {
  18. fmt.Println("抖音信息=====", send)
  19. return data, err.Error()
  20. }
  21. if gjson.Get(send, "code").Int() != 10000 {
  22. fmt.Println("抖音信息=====", send)
  23. return data, gjson.Get(send, "sub_msg").String()
  24. }
  25. data["deeplink"] = gjson.Get(send, "data.deep_link").String()
  26. data["content"] = php2go.Base64Encode(gjson.Get(send, "data.share_command").String())
  27. data["qr_code"] = gjson.Get(send, "data.qrcode.url").String()
  28. return data, ""
  29. }