api_brands.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 爱心餐对外API
  4. //
  5. // 微信支付爱心餐公益计划旨在面向深圳市的市政一线环卫工人提供每周一餐的1分钱用餐公益服务。在受助端,微信支付联动上千家餐饮门店关爱特殊人群,通过微信支付数字化能力将人群身份认证与公益福利领用全流程线上化,实现公益福利精准到人。在捐赠端,微信支付发挥连接优势与平台能力,结合用户就餐场景通过爱心餐一块捐插件让用户可在点餐时顺手捐1元,带动更多社会力量致谢城市美容师。
  6. //
  7. // API version: 0.0.4
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package lovefeast
  10. import (
  11. "context"
  12. "fmt"
  13. nethttp "net/http"
  14. neturl "net/url"
  15. "strings"
  16. "git.nanodreamtech.com/sg/wechatpay-go/core"
  17. "git.nanodreamtech.com/sg/wechatpay-go/core/consts"
  18. "git.nanodreamtech.com/sg/wechatpay-go/services"
  19. )
  20. type BrandsApiService services.Service
  21. // GetBrand 查询爱心餐品牌信息
  22. //
  23. // 接口介绍:商户根据品牌ID查询爱心餐品牌的捐赠与供餐信息
  24. // 适用对象:服务商、直连商户
  25. func (a *BrandsApiService) GetBrand(ctx context.Context, req GetBrandRequest) (resp *BrandEntity, result *core.APIResult, err error) {
  26. var (
  27. localVarHTTPMethod = nethttp.MethodGet
  28. localVarPostBody interface{}
  29. localVarQueryParams neturl.Values
  30. localVarHeaderParams = nethttp.Header{}
  31. )
  32. // Make sure Path Params are properly set
  33. if req.BrandId == nil {
  34. return nil, nil, fmt.Errorf("field `BrandId` is required and must be specified in GetBrandRequest")
  35. }
  36. localVarPath := consts.WechatPayAPIServer + "/v3/lovefeast/brands/{brand_id}"
  37. // Build Path with Path Params
  38. localVarPath = strings.Replace(localVarPath, "{"+"brand_id"+"}", neturl.PathEscape(core.ParameterToString(*req.BrandId, "")), -1)
  39. // Make sure All Required Params are properly set
  40. // Determine the Content-Type Header
  41. localVarHTTPContentTypes := []string{}
  42. // Setup Content-Type
  43. localVarHTTPContentType := core.SelectHeaderContentType(localVarHTTPContentTypes)
  44. // Perform Http Request
  45. result, err = a.Client.Request(ctx, localVarHTTPMethod, localVarPath, localVarHeaderParams, localVarQueryParams, localVarPostBody, localVarHTTPContentType)
  46. if err != nil {
  47. return nil, result, err
  48. }
  49. // Extract BrandEntity from Http Response
  50. resp = new(BrandEntity)
  51. err = core.UnMarshalResponse(result.Response, resp)
  52. if err != nil {
  53. return nil, result, err
  54. }
  55. return resp, result, nil
  56. }