a05.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package adm
  2. import (
  3. "gd_service/apis"
  4. "gd_service/consts"
  5. "gd_service/errors"
  6. )
  7. /*
  8. func A05(ctx context.Context, vin string, reply map[string]string, lReqs *[]apis.ThirdpartLogWrite, providerMap map[string]apis.MerchantProviderLimitInfo, rangeNo int) error {
  9. if CheckProviderApiIsAvaliable(dutils.ADMA05, providerMap, rangeNo) == nil {
  10. str, err := (&Adm{
  11. Ctx: ctx,
  12. Params: map[string]string{
  13. "vin": vin,
  14. },
  15. Code: consts.A05,
  16. LReqs: lReqs,
  17. Provider: providerMap[dutils.ADMA05+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 A05(req *apis.ThirdpartRequest) (reply string, err error) {
  29. req.LReq.Search = req.Params["vin"]
  30. req.ProviderInfo.ThirdpartApiRouter = consts.A05
  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. }