a001.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. // 车牌查车辆信息
  13. func A001(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error {
  14. rData := req.Data.(map[string]interface{})
  15. plateNo := rData["plate_no"].(string)
  16. plateType := rData["plate_type"].(string)
  17. if plateNo == "" && plateType == "" {
  18. return errors.ArgsError
  19. }
  20. MerchantProviderLimitInfoList, err := utils.GetProviderInfo(req.MerchantApiInfo.MerchantChildApiId, req.BaseApiId)
  21. if err != nil {
  22. return errors.ServiceError
  23. }
  24. providerMap, _ := utils.GenProviderInfoMapNew(MerchantProviderLimitInfoList)
  25. respData := make(map[string]string)
  26. // TODO 定义返回字段
  27. err = adm.A04(ctx, plateNo, plateType, "", respData, &reply.LReq, providerMap, consts.RANGEONE)
  28. if err == nil {
  29. reply.Data = respData
  30. return nil
  31. } else {
  32. return errors.NoRecord
  33. }
  34. }