a002.go 939 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package vehicle
  4. import (
  5. "context"
  6. "gd_vehicle/apis"
  7. "gd_vehicle/consts"
  8. "gd_vehicle/errors"
  9. "gd_vehicle/impl/thirdparty_impl/adm"
  10. "gd_vehicle/utils"
  11. )
  12. // vin查车辆信息
  13. func A002(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error {
  14. rData := req.Data.(map[string]interface{})
  15. vin := rData["vin"].(string)
  16. MerchantProviderLimitInfoList, err := utils.GetProviderInfo(req.MerchantApiInfo.MerchantChildApiId, req.BaseApiId)
  17. if err != nil {
  18. return errors.ServiceError
  19. }
  20. providerMap, _ := utils.GenProviderInfoMapNew(MerchantProviderLimitInfoList)
  21. respData := make(map[string]string)
  22. // TODO 定义返回字段
  23. err = adm.A04(ctx, "", "", vin, respData, &reply.LReq, providerMap, consts.RANGEONE)
  24. if err == nil {
  25. reply.Data = respData
  26. return nil
  27. } else {
  28. return errors.NoRecord
  29. }
  30. }