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

98 lines
3.6 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) {
  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. }
  36. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  37. func GetKuishouActivity(signSecret string, param map[string]string) (string, error) {
  38. return SendGet("open.distribution.investment.activity.open.list", signSecret, param)
  39. }
  40. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.investment.activity.open.list&version=1
  41. func GetKuishouGoods(signSecret string, param map[string]string) (string, error) {
  42. return SendGet("open.distribution.investment.activity.open.item.list", signSecret, param)
  43. }
  44. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.list&version=1
  45. func GetKuishouMyActivity(signSecret string, param map[string]string) (string, error) {
  46. return SendGet("open.distribution.second.apply.investment.activity.list", signSecret, param)
  47. }
  48. //
  49. ////https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.second.apply.investment.activity.item.list&version=1
  50. func GetKuishouMyGoods(signSecret string, param map[string]string) (string, error) {
  51. return SendGet("open.distribution.second.apply.investment.activity.item.list", signSecret, param)
  52. }
  53. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.cursor.list&version=1
  54. func GetKuishouOrder(signSecret string, param map[string]string) (string, error) {
  55. return SendGet("open.distribution.cps.leader.order.cursor.list", signSecret, param)
  56. }
  57. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.leader.order.detail&version=1
  58. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.cps.kwaimoney.selection.item.list&version=1
  59. func GetKuishouCpsGoods(signSecret string, param map[string]string) (string, error) {
  60. return SendGet("open.distribution.cps.kwaimoney.selection.item.list", signSecret, param)
  61. }
  62. func GetKuishouCpsGoodsDetail(signSecret string, param map[string]string) (string, error) {
  63. return SendGet("open.distribution.cps.kwaimoney.selection.item.detail", signSecret, param)
  64. }
  65. func GetKuishouCpsKlGoods(signSecret string, param map[string]string) (string, error) {
  66. return SendPost("open.distribution.cps.kwaimoney.link.parse", signSecret, param)
  67. }
  68. func GetKuishouCpsUrl(signSecret string, param map[string]string) (string, error) {
  69. return SendPost("open.distribution.cps.kwaimoney.link.create", signSecret, param)
  70. }
  71. func GetKuishouCpsPid(signSecret string, param map[string]string) (string, error) {
  72. return SendPost("open.distribution.cps.kwaimoney.pid.create", signSecret, param)
  73. }
  74. func GetKuishouCpsOrder(signSecret string, param map[string]string) (string, error) {
  75. return SendPost("open.distribution.cps.kwaimoney.order.list", signSecret, param)
  76. }
  77. //https://open.kwaixiaodian.com/zone/docs/api?name=open.distribution.selection.pick&version=1 橱窗