is01.go 766 B

123456789101112131415161718192021222324252627282930313233343536
  1. package adm
  2. import (
  3. "context"
  4. "gd_vehicle/apis"
  5. "gd_vehicle/common.in/utils"
  6. "gd_vehicle/consts"
  7. "gd_vehicle/errors"
  8. "strconv"
  9. dutils "gd_vehicle/utils"
  10. )
  11. func IS01(ctx context.Context, vin string, reply map[string]string, lReqs *[]apis.ThirdpartLogWrite, providerMap map[string]apis.MerchantProviderLimitInfo, rangeNo int) error {
  12. if CheckProviderApiIsAvaliable(dutils.ADMIS01, providerMap, rangeNo) == nil {
  13. str, err := (&Adm{
  14. Ctx: ctx,
  15. Params: map[string]string{
  16. "vin": vin,
  17. },
  18. Code: consts.IS01,
  19. LReqs: lReqs,
  20. Provider: providerMap[dutils.ADMIS01+strconv.Itoa(rangeNo)],
  21. }).Request()
  22. if err != nil {
  23. return err
  24. }
  25. utils.Convertion(reply, str)
  26. } else {
  27. return errors.ProviderUnavailable
  28. }
  29. return nil
  30. }