Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
1d73db91
Commit
1d73db91
authored
Dec 14, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check服务优化
parent
5a2a8593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
7 deletions
+32
-7
ChecksConstants.java
...om/yifu/cloud/plus/v1/check/constant/ChecksConstants.java
+3
-1
ChecksUtil.java
...n/java/com/yifu/cloud/plus/v1/check/utils/ChecksUtil.java
+29
-6
No files found.
yifu-check/yifu-check-api/src/main/java/com/yifu/cloud/plus/v1/check/constant/ChecksConstants.java
View file @
1d73db91
...
...
@@ -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"
;
...
...
yifu-check/yifu-check-api/src/main/java/com/yifu/cloud/plus/v1/check/utils/ChecksUtil.java
View file @
1d73db91
...
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment