a04.go 858 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. dutils "gd_vehicle/utils"
  9. "strconv"
  10. )
  11. // reply 必须是指针
  12. func A04(ctx context.Context, plateNo, plateType, vin string, reply map[string]string, lReqs *[]apis.ThirdpartLogWrite, providerMap map[string]apis.MerchantProviderLimitInfo, rangeNo int) error {
  13. // ADM-A04
  14. if CheckProviderApiIsAvaliable(dutils.ADMA04, providerMap, rangeNo) == nil {
  15. str, err := (&Adm{
  16. Ctx: ctx,
  17. Params: map[string]string{
  18. "plate_no": plateNo,
  19. "plate_type": plateType,
  20. },
  21. Code: consts.A04,
  22. LReqs: lReqs,
  23. Provider: providerMap[dutils.ADMA04+strconv.Itoa(rangeNo)],
  24. }).Request()
  25. if err != nil {
  26. return err
  27. }
  28. utils.Convertion(reply, str)
  29. } else {
  30. return errors.ProviderUnavailable
  31. }
  32. return nil
  33. }