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

102 lines
3.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) {
  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. }
  27. /*
  28. */
  29. func GetKuaishouRefreshToken(args map[string]string) (string, error) {
  30. url := "https://openapi.kwaixiaodian.com/oauth2/refresh_token"
  31. get, err := zhios_third_party_utils.CurlPost(url, args, nil)
  32. fmt.Println(url)
  33. fmt.Println(string(get))
  34. fmt.Println(err)
  35. return string(get), err
  36. }
  37. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  38. func GetKuishouActivity(signSecret string, param map[string]string) (string, error) {
  39. return SendGet("open.distribution.investment.activity.open.list", signSecret, param)
  40. }
  41. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  42. func GetKuishouGoods(signSecret string, param map[string]string) (string, error) {
  43. return SendGet("open.distribution.investment.activity.open.item.list", signSecret, param)
  44. }
  45. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.list&version=1
  46. func GetKuishouMyActivity(signSecret string, param map[string]string) (string, error) {
  47. return SendGet("open.distribution.second.apply.investment.activity.list", signSecret, param)
  48. }
  49. //
  50. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.item.list&version=1
  51. func GetKuishouMyGoods(signSecret string, param map[string]string) (string, error) {
  52. return SendGet("open.distribution.second.apply.investment.activity.item.list", signSecret, param)
  53. }
  54. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.cursor.list&version=1
  55. func GetKuishouOrder(signSecret string, param map[string]string) (string, error) {
  56. return SendGet("open.distribution.cps.leader.order.cursor.list", signSecret, param)
  57. }
  58. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.detail&version=1
  59. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.kwaimoney.selection.item.list&version=1
  60. func GetKuishouCpsGoods(signSecret string, param map[string]string) (string, error) {
  61. return SendGet("open.distribution.cps.kwaimoney.selection.item.list", signSecret, param)
  62. }
  63. func GetKuishouCpsGoodsDetail(signSecret string, param map[string]string) (string, error) {
  64. return SendGet("open.distribution.cps.kwaimoney.selection.item.detail", signSecret, param)
  65. }
  66. func GetKuishouCpsKlGoods(signSecret string, param map[string]string) (string, error) {
  67. return SendPost("open.distribution.cps.kwaimoney.link.parse", signSecret, param)
  68. }
  69. func GetKuishouCpsUrl(signSecret string, param map[string]string) (string, error) {
  70. return SendPost("open.distribution.cps.kwaimoney.link.create", signSecret, param)
  71. }
  72. func GetKuishouCpsPid(signSecret string, param map[string]string) (string, error) {
  73. return SendPost("open.distribution.cps.kwaimoney.pid.create", signSecret, param)
  74. }
  75. func GetKuishouCpsOrder(signSecret string, param map[string]string) (string, error) {
  76. return SendPost("open.distribution.cps.kwaimoney.order.list", signSecret, param)
  77. }
  78. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.selection.pick&version=1 橱窗
  79. func GetKuishouSelectionPick(signSecret string, param map[string]string) (string, error) {
  80. return SendPost("open.distribution.selection.pick", signSecret, param)
  81. }