v001.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 gentensh.com. All rights reserved.
  2. // Use of this source code is governed by gentensh.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 V001(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. owner := rData["owner"].(string)
  18. MerchantProviderLimitInfoList, err := utils.GetProviderInfo(req.MerchantApiInfo.MerchantChildApiId, req.BaseApiId)
  19. if err != nil {
  20. return errors.ServiceError
  21. }
  22. providerMap, _ := utils.GenProviderInfoMapNew(MerchantProviderLimitInfoList)
  23. respData := make(map[string]string)
  24. isMatch, err := adm.V01(ctx, plateNo, plateType, owner, &reply.LReq, providerMap, consts.RANGEONE)
  25. if err == nil {
  26. respData["is_match"] = isMatch
  27. reply.Data = respData
  28. return nil
  29. } else {
  30. return errors.NoRecord
  31. }
  32. }