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

92 regels
5.1 KiB

  1. package taobao
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/taobao/topsdk"
  4. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/taobao/topsdk/defaultability"
  5. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/taobao/topsdk/defaultability/domain"
  6. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/taobao/topsdk/defaultability/request"
  7. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/taobao/topsdk/defaultability/response"
  8. zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
  9. )
  10. const (
  11. ELM_URL = "https://eco.taobao.com/router/rest"
  12. )
  13. func ElemePromotionOfficialactivityGet(ak, sk string, args map[string]interface{}) (*response.AlibabaAlscUnionElemePromotionOfficialactivityGetResponse, error) {
  14. client := topsdk.NewDefaultTopClient(ak, sk, ELM_URL, 20000, 20000)
  15. ability := defaultability.NewDefaultability(&client)
  16. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest := domain.AlibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest{}
  17. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest.SetPid(zhios_third_party_utils.AnyToString(args["pid"]))
  18. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest.SetActivityId(zhios_third_party_utils.AnyToString(args["activity_id"]))
  19. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest.SetSid(zhios_third_party_utils.AnyToString(args["sid"]))
  20. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest.SetIncludeWxImg(zhios_third_party_utils.AnyToBool(args["include_wx_img"]))
  21. alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest.SetIncludeQrCode(zhios_third_party_utils.AnyToBool(args["include_qrcode"]))
  22. req := request.AlibabaAlscUnionElemePromotionOfficialactivityGetRequest{}
  23. req.SetQueryRequest(alibabaAlscUnionElemePromotionOfficialactivityGetActivityRequest)
  24. resp, err := ability.AlibabaAlscUnionElemePromotionOfficialactivityGet(&req)
  25. if err != nil {
  26. return nil, err
  27. }
  28. return resp, nil
  29. }
  30. func AlibabaAlscUnionKbcpxPositiveOrder(ak, sk string, args map[string]interface{}) (*response.AlibabaAlscUnionKbcpxPositiveOrderGetResponse, error) {
  31. client := topsdk.NewDefaultTopClient(ak, sk, ELM_URL, 20000, 20000)
  32. ability := defaultability.NewDefaultability(&client)
  33. req := request.AlibabaAlscUnionKbcpxPositiveOrderGetRequest{}
  34. req.SetDateType(zhios_third_party_utils.AnyToInt64(args["date_type"])) //时间维度,1-付款时间 2-创建时间 3-结算时间 4-更新时间
  35. if args["settle_state"] != "" {
  36. req.SetSettleState(zhios_third_party_utils.AnyToInt64(args["settle_state"]))
  37. } //结算状态,1-已结算 2-未结算 不传-全部状态
  38. req.SetEndDate(zhios_third_party_utils.AnyToString(args["end_date"]))
  39. req.SetBizUnit(zhios_third_party_utils.AnyToInt64(args["biz_unit"])) // 1-CPA 2-CPS
  40. req.SetPageSize(zhios_third_party_utils.AnyToInt64(args["page_size"]))
  41. req.SetPageNumber(zhios_third_party_utils.AnyToInt64(args["page"]))
  42. req.SetStartDate(zhios_third_party_utils.AnyToString(args["start_date"]))
  43. if args["order_state"] != "" {
  44. req.SetOrderState(zhios_third_party_utils.AnyToInt64(args["order_state"]))
  45. } //订单状态,0-已失效 1-已下单 2-已付款 4-已收货 不传-全部状态
  46. if args["flow_type"] != "" {
  47. req.SetFlowType(zhios_third_party_utils.AnyToString(args["flow_type"]))
  48. } //场景值,支持多场景(英文逗号分隔)查询7卡券订单,8卡券核销订单,10-媒体出资CPS红包,11-媒体出资霸王餐加码红包
  49. req.SetPid(zhios_third_party_utils.AnyToString(args["pid"]))
  50. if args["order_id"] != "" {
  51. req.SetOrderId(zhios_third_party_utils.AnyToString(args["order_id"]))
  52. }
  53. resp, err := ability.AlibabaAlscUnionKbcpxPositiveOrderGet(&req)
  54. if err != nil {
  55. return nil, err
  56. }
  57. return resp, nil
  58. }
  59. func AlibabaAlscUnionKbcpxRefundOrder(ak, sk string, args map[string]interface{}) (*response.AlibabaAlscUnionKbcpxRefundOrderGetResponse, error) {
  60. client := topsdk.NewDefaultTopClient(ak, sk, ELM_URL, 20000, 20000)
  61. ability := defaultability.NewDefaultability(&client)
  62. req := request.AlibabaAlscUnionKbcpxRefundOrderGetRequest{}
  63. req.SetDateType(zhios_third_party_utils.AnyToInt64(args["date_type"])) //时间维度,1-付款时间 2-创建时间 3-结算时间 4-更新时间
  64. req.SetEndDate(zhios_third_party_utils.AnyToString(args["end_date"]))
  65. req.SetBizUnit(zhios_third_party_utils.AnyToInt64(args["biz_unit"])) // 1-CPA 2-CPS
  66. req.SetPageSize(zhios_third_party_utils.AnyToInt64(args["page_size"]))
  67. req.SetPageNumber(zhios_third_party_utils.AnyToInt64(args["page"]))
  68. req.SetStartDate(zhios_third_party_utils.AnyToString(args["start_date"]))
  69. if args["flow_type"] != "" {
  70. req.SetFlowType(zhios_third_party_utils.AnyToString(args["flow_type"]))
  71. } //场景值,支持多场景(英文逗号分隔)查询7卡券订单,8卡券核销订单,10-媒体出资CPS红包,11-媒体出资霸王餐加码红包
  72. req.SetPid(zhios_third_party_utils.AnyToString(args["pid"]))
  73. if args["order_id"] != "" {
  74. req.SetOrderId(zhios_third_party_utils.AnyToString(args["order_id"]))
  75. }
  76. resp, err := ability.AlibabaAlscUnionKbcpxRefundOrderGet(&req)
  77. if err != nil {
  78. return nil, err
  79. }
  80. return resp, nil
  81. }