Commit 1d73db91 authored by fangxinjiang's avatar fangxinjiang

check服务优化

parent 5a2a8593
......@@ -8,7 +8,9 @@ package com.yifu.cloud.plus.v1.check.constant;
*/
public interface ChecksConstants {
String NACOS_CHECK_CONFIG_ERROR="nacos中checks.yaml的配置canCheck未开启!";
String NACOS_CHECK_CONFIG_ERROR="校验服务验证开关关闭!";
String CHECK_CONFIG_ACCESS="校验服务验证关闭,自动放行!";
String CODE="code";
......
......@@ -13,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -39,8 +40,10 @@ public class ChecksUtil {
// 1.调用身份信息校验api
checkIdCardMethod(checkIdCard);
} else {
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
//checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
//checkIdCard.setReason(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
checkIdCard.setIsTrue(CommonConstants.ONE_INT);
checkIdCard.setReason(ChecksConstants.CHECK_CONFIG_ACCESS);
}
}
/**
......@@ -52,10 +55,23 @@ public class ChecksUtil {
public static R<Map<String,TCheckMobile>> checkMobile(String mobiles, boolean canCheck) {
Map<String,TCheckMobile> checkMobiles = new HashMap<>();
if (canCheck) {
// 1.调用身份信息校验api
// 1.调用手机信息校验api
return checkMobileMethod(mobiles,checkMobiles);
} else {
return R.failed(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
TCheckMobile checkMobile;
List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING);
Map<String,TCheckMobile> resMap = new HashMap<>();
if (Common.isNotNull(mobileList)){
for (String m:mobileList){
checkMobile = new TCheckMobile();
checkMobile.setMobile(m);
checkMobile.setStatus(CommonConstants.ONE_STRING);
checkMobile.setType(CommonConstants.ONE_STRING);
checkMobile.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
resMap.put(m,checkMobile);
}
}
return R.ok(resMap);
}
}
/**
......@@ -67,10 +83,17 @@ public class ChecksUtil {
**/
public static R<TCheckBankNo> checkBankNoTwo(String name, String cardNo, boolean canCheck) {
if (canCheck) {
// 1.调用身份信息校验api
// 1.调用银行卡信息校验api
return checkBankNoTwoMethod(name,cardNo);
} else {
return R.failed(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
TCheckBankNo checkBankNo = new TCheckBankNo();
checkBankNo.setBankNo(cardNo);
checkBankNo.setName(name);
checkBankNo.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
checkBankNo.setResult("01");
checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setRemark(ChecksConstants.CHECK_CONFIG_ACCESS);
return R.ok(checkBankNo);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment