第三方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.

119 line
4.8 KiB

  1. package kuaishou
  2. import (
  3. zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
  4. "fmt"
  5. "strings"
  6. )
  7. /*
  8. app_id 开发者appKey
  9. grant_type 授权的类型,"code"
  10. code 2.2中获取到的code
  11. app_secret 开发者的appSecret
  12. */
  13. func GetKuaishouToken(args map[string]string) (string, error) {
  14. url := "https://openapi.kwaixiaodian.com/oauth2/access_token"
  15. for k, v := range args {
  16. if strings.Contains(url, "?") == false {
  17. url += "?" + k + "=" + v
  18. } else {
  19. url += "&" + k + "=" + v
  20. }
  21. }
  22. get, err := zhios_third_party_utils.CurlGet(url, nil)
  23. fmt.Println(url)
  24. fmt.Println(string(get))
  25. fmt.Println(err)
  26. return string(get), err
  27. }
  28. /*
  29. */
  30. func GetKuaishouRefreshToken(args map[string]string) (string, error) {
  31. url := "https://openapi.kwaixiaodian.com/oauth2/refresh_token"
  32. get, err := zhios_third_party_utils.CurlPost(url, args, nil)
  33. fmt.Println(url)
  34. fmt.Println(string(get))
  35. fmt.Println(err)
  36. return string(get), err
  37. }
  38. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  39. func GetKuishouActivity(signSecret string, param map[string]string) (string, error) {
  40. return SendGet("open.distribution.investment.activity.open.list", signSecret, param)
  41. }
  42. //https://open.kwaixiaodian.com/zone/new/docs/api?name=open.distribution.investment.activity.item.detail&version=1
  43. func GetKuishouGoodsDetail(signSecret string, param map[string]string) (string, error) {
  44. return SendGet("open.distribution.investment.activity.item.detail", signSecret, param)
  45. }
  46. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  47. func GetKuishouGoods(signSecret string, param map[string]string) (string, error) {
  48. return SendGet("open.distribution.investment.activity.open.item.list", signSecret, param)
  49. }
  50. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.list&version=1
  51. func GetKuishouMyActivity(signSecret string, param map[string]string) (string, error) {
  52. return SendGet("open.distribution.second.apply.investment.activity.list", signSecret, param)
  53. }
  54. //
  55. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.item.list&version=1
  56. func GetKuishouMyGoods(signSecret string, param map[string]string) (string, error) {
  57. return SendGet("open.distribution.second.apply.investment.activity.item.list", signSecret, param)
  58. }
  59. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.cursor.list&version=1
  60. func GetKuishouOrder(signSecret string, param map[string]string) (string, error) {
  61. return SendGet("open.distribution.cps.leader.order.cursor.list", signSecret, param)
  62. }
  63. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.detail&version=1
  64. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.selection.pick&version=1 橱窗
  65. func GetKuishouSelectionPick(signSecret string, param map[string]string) (string, error) {
  66. return SendPost("open.distribution.selection.pick", signSecret, param)
  67. }
  68. //https://open.kwaixiaodian.com/zone/docs/api?name=open.user.info.get&version=1 用户信息
  69. func GetKuishouUser(signSecret string, param map[string]string) (string, error) {
  70. return SendGet("open.user.info.get", signSecret, param)
  71. }
  72. func GetKuishouOrderDetail(signSecret string, param map[string]string) (string, error) {
  73. return SendGet("open.distribution.cps.leader.order.detail", signSecret, param)
  74. }
  75. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.kwaimoney.selection.item.list&version=1
  76. func GetKuishouCpsGoods(signSecret string, param map[string]string) (string, error) {
  77. return SendGet("open.distribution.cps.kwaimoney.selection.item.list", signSecret, param)
  78. }
  79. func GetKuishouCpsGoodsDetail(signSecret string, param map[string]string) (string, error) {
  80. return SendGet("open.distribution.cps.kwaimoney.selection.item.detail", signSecret, param)
  81. }
  82. func GetKuishouCpsKlGoods(signSecret string, param map[string]string) (string, error) {
  83. return SendPost("open.distribution.cps.kwaimoney.link.parse", signSecret, param)
  84. }
  85. func GetKuishouCpsUrl(signSecret string, param map[string]string) (string, error) {
  86. return SendPost("open.distribution.cps.kwaimoney.link.create", signSecret, param)
  87. }
  88. func GetKuishouCpsPid(signSecret string, param map[string]string) (string, error) {
  89. return SendPost("open.distribution.cps.kwaimoney.pid.create", signSecret, param)
  90. }
  91. func GetKuishouCpsOrder(signSecret string, param map[string]string) (string, error) {
  92. return SendPost("open.distribution.cps.kwaimoney.order.list", signSecret, param)
  93. }
  94. func GetKuishouCpsChannel(signSecret string, param map[string]string) (string, error) {
  95. return SendGet("open.distribution.cps.kwaimoney.selection.channel.list", signSecret, param)
  96. }