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

110 regels
4.3 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/docs/api?name=open.distribution.investment.activity.open.list&version=1
  43. func GetKuishouGoods(signSecret string, param map[string]string) (string, error) {
  44. return SendGet("open.distribution.investment.activity.open.item.list", signSecret, param)
  45. }
  46. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.list&version=1
  47. func GetKuishouMyActivity(signSecret string, param map[string]string) (string, error) {
  48. return SendGet("open.distribution.second.apply.investment.activity.list", signSecret, param)
  49. }
  50. //
  51. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.item.list&version=1
  52. func GetKuishouMyGoods(signSecret string, param map[string]string) (string, error) {
  53. return SendGet("open.distribution.second.apply.investment.activity.item.list", signSecret, param)
  54. }
  55. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.cursor.list&version=1
  56. func GetKuishouOrder(signSecret string, param map[string]string) (string, error) {
  57. return SendGet("open.distribution.cps.leader.order.cursor.list", signSecret, param)
  58. }
  59. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.detail&version=1
  60. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.selection.pick&version=1 橱窗
  61. func GetKuishouSelectionPick(signSecret string, param map[string]string) (string, error) {
  62. return SendPost("open.distribution.selection.pick", signSecret, param)
  63. }
  64. //https://open.kwaixiaodian.com/zone/docs/api?name=open.user.info.get&version=1 用户信息
  65. func GetKuishouUser(signSecret string, param map[string]string) (string, error) {
  66. return SendGet("open.user.info.get", signSecret, param)
  67. }
  68. func GetKuishouOrderDetail(signSecret string, param map[string]string) (string, error) {
  69. return SendGet("open.distribution.cps.leader.order.detail", signSecret, param)
  70. }
  71. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.kwaimoney.selection.item.list&version=1
  72. func GetKuishouCpsGoods(signSecret string, param map[string]string) (string, error) {
  73. return SendGet("open.distribution.cps.kwaimoney.selection.item.list", signSecret, param)
  74. }
  75. func GetKuishouCpsGoodsDetail(signSecret string, param map[string]string) (string, error) {
  76. return SendGet("open.distribution.cps.kwaimoney.selection.item.detail", signSecret, param)
  77. }
  78. func GetKuishouCpsKlGoods(signSecret string, param map[string]string) (string, error) {
  79. return SendPost("open.distribution.cps.kwaimoney.link.parse", signSecret, param)
  80. }
  81. func GetKuishouCpsUrl(signSecret string, param map[string]string) (string, error) {
  82. return SendPost("open.distribution.cps.kwaimoney.link.create", signSecret, param)
  83. }
  84. func GetKuishouCpsPid(signSecret string, param map[string]string) (string, error) {
  85. return SendPost("open.distribution.cps.kwaimoney.pid.create", signSecret, param)
  86. }
  87. func GetKuishouCpsOrder(signSecret string, param map[string]string) (string, error) {
  88. return SendPost("open.distribution.cps.kwaimoney.order.list", signSecret, param)
  89. }