a02.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package adm
  2. import (
  3. "gd_service/apis"
  4. "gd_service/consts"
  5. "gd_service/errors"
  6. )
  7. /*func A02(ctx context.Context, vin, plateType string, reply map[string]string, lReqs *[]apis.ThirdpartLogWrite, providerMap map[string]apis.MerchantProviderLimitInfo, rangeNo int) error {
  8. if CheckProviderApiIsAvaliable(dutils.ADMA02, providerMap, rangeNo) == nil {
  9. str, err := (&Adm{
  10. Ctx: ctx,
  11. Params: map[string]string{
  12. "vin": vin,
  13. "plate_type": plateType,
  14. },
  15. Code: consts.A02,
  16. LReqs: lReqs,
  17. Provider: providerMap[dutils.ADMA02+strconv.Itoa(rangeNo)],
  18. }).Request()
  19. if err != nil {
  20. return err
  21. }
  22. utils.Convertion(reply, str)
  23. } else {
  24. return errors.ProviderUnavailable
  25. }
  26. return nil
  27. }*/
  28. func A02(req *apis.ThirdpartRequest) (reply string, err error) {
  29. req.LReq.Search = req.Params["vin"]
  30. req.ProviderInfo.ThirdpartApiRouter = consts.A02
  31. str, err := AdmRequest(req)
  32. if err != nil {
  33. return "", err
  34. }
  35. if str == "" {
  36. return "", errors.VendorError
  37. }
  38. //respData := make(map[string]string)
  39. //utils.Convertion(respData, str)
  40. return str, nil
  41. }