记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
ce851267
Commit
ce851267
authored
Aug 17, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+api:用户身份信息获取、验证手机号;
parent
953bf34c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
37 deletions
+101
-37
AdamUserIdentityInfoVo.java
...liquidnet/service/adam/dto/vo/AdamUserIdentityInfoVo.java
+54
-0
AbstractRedisUtil.java
....liquidnet.common.cache/redis/util/AbstractRedisUtil.java
+9
-0
db_ln_adam_initialdata.sql
...quidnet-service-adam-impl/docu/db_ln_adam_initialdata.sql
+4
-0
AdamUserController.java
...liquidnet/service/adam/controller/AdamUserController.java
+32
-35
errors.properties
...et-service-adam-impl/src/main/resources/errors.properties
+2
-2
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamUserIdentityInfoVo.java
0 → 100644
View file @
ce851267
package
com
.
liquidnet
.
service
.
adam
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.DESUtils
;
import
com.liquidnet.commons.lang.util.SensitizeUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"AdamUserIdentityVo"
,
description
=
"用户身份信息"
)
@Data
public
class
AdamUserIdentityInfoVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
5828611827493373384L
;
@ApiModelProperty
(
position
=
10
,
value
=
"用户ID[30]"
)
private
String
uid
;
@ApiModelProperty
(
position
=
11
,
value
=
"脱敏姓名[30]"
)
private
String
name
;
@ApiModelProperty
(
position
=
12
,
value
=
"脱敏手机号[11]"
)
private
String
mobile
;
@ApiModelProperty
(
position
=
15
,
value
=
"数据包"
)
private
String
packet
;
private
static
final
AdamUserIdentityInfoVo
obj
=
new
AdamUserIdentityInfoVo
();
public
static
AdamUserIdentityInfoVo
getNew
()
{
return
obj
.
clone
();
}
@Override
public
AdamUserIdentityInfoVo
clone
()
{
try
{
return
(
AdamUserIdentityInfoVo
)
super
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
AdamUserIdentityInfoVo
();
}
}
/**
* 脱敏处理
*
* @return AdamUserIdentityVo
*/
public
AdamUserIdentityInfoVo
desensitize
()
{
try
{
this
.
packet
=
DESUtils
.
DES
().
encrypt
(
uid
.
concat
(
","
).
concat
(
name
).
concat
(
","
).
concat
(
mobile
));
}
catch
(
Exception
e
)
{
this
.
packet
=
"Nil"
;
}
this
.
setName
(
SensitizeUtil
.
custom
(
this
.
getName
(),
0
,
1
));
this
.
setMobile
(
SensitizeUtil
.
custom
(
this
.
getMobile
(),
3
,
4
));
return
this
;
}
}
liquidnet-bus-common/liquidnet-common-cache/liquidnet-common-cache-redis/src/main/java/com.liquidnet.common.cache/redis/util/AbstractRedisUtil.java
View file @
ce851267
...
...
@@ -171,6 +171,15 @@ public abstract class AbstractRedisUtil {
// ============================String=============================
public
Long
ttl
(
String
key
)
{
if
(
null
==
key
)
{
return
0L
;
}
key
=
this
.
fillingKey
(
key
);
return
this
.
getRedisConfig
().
getRedisTemplateByDb
(
this
.
getIndex
(
key
)).
opsForValue
().
getOperations
().
getExpire
(
key
);
}
/**
* 普通缓存获取
*
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/docu/db_ln_adam_initialdata.sql
View file @
ce851267
...
...
@@ -499,6 +499,10 @@ alter table adam_addresses add town varchar(50) null comment '街道/镇' after
alter
table
adam_addresses
add
town_id
varchar
(
20
)
null
comment
'街道行政编码'
after
town
;
alter
table
adam_addresses
modify
address
varchar
(
255
)
not
null
comment
'详细地址'
;
alter
table
adam_addresses
add
full_address
varchar
(
500
)
null
comment
'完整地址'
after
address
;
-- >>------------------------------------------------------------------------------------ |20220323三要素实名
alter
table
adam_real_name
add
node
tinyint
default
2
not
null
comment
'认证节点[2-二要素|3-三要素]'
after
type
;
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamUserController.java
View file @
ce851267
...
...
@@ -467,41 +467,38 @@ public class AdamUserController {
}
}
// @ApiOperationSupport(order = 11)
// @ApiOperation(value = "业务账号开通")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "bizCode", value = "业务码[NFT_ZX]", allowableValues = "NFT_ZX"),
// @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "name", value = "姓名"),
// @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "idCard", value = "身份证号"),
// })
// @PostMapping(value = "open/account")
// public ResponseDto<AdamUserBizAcctVo> openAccount(@Pattern(regexp = "\\b(NFT_ZX)\\b", message = "业务码无效")
// @RequestParam String bizCode,
// @RequestParam(required = false) String name,
// @RequestParam(required = false) String idCard) {
// if (StringUtils.isNotBlank(name) && !name.contains("*")) {
// if (!java.util.regex.Pattern.matches(LnsRegex.Valid.CN_HANZI, name)) {
// return ResponseDto.failure(ErrorMapping.get("10103"));
// }
// if (!java.util.regex.Pattern.matches(LnsRegex.Valid.CN_ID_CARD_REF, idCard)) {
// return ResponseDto.failure(ErrorMapping.get("10104"));
// }
// if (IDCardUtil.getAge(idCard) < 18) {
// return ResponseDto.failure(ErrorMapping.get("10100"));
// }
// }
// String currentUid = CurrentUtil.getCurrentUid();
// String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE);
// try {
// return adamUserBusiAcctService.openAccount(currentUid, bizCode, name, idCard, mobile);
// } catch (Exception e) {
// if (e instanceof LiquidnetServiceException) {
// LiquidnetServiceException lsEx = (LiquidnetServiceException) e;
// return ResponseDto.failure(lsEx.getCode(), lsEx.getMessage());
// }
// return ResponseDto.failure(ErrorMapping.get("10113"));
// }
// }
@ApiOperationSupport
(
order
=
11
)
@ApiOperation
(
value
=
"用户身份信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号"
),
})
@GetMapping
(
value
=
"info/identity"
)
public
ResponseDto
<
AdamUserIdentityInfoVo
>
identityInfoByMobile
(
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@RequestParam
(
name
=
"mobile"
,
required
=
false
)
String
mobile
)
{
String
uid
=
null
==
mobile
?
CurrentUtil
.
getCurrentUid
()
:
adamRdmService
.
getUidByMobile
(
mobile
);
AdamUserInfoVo
userInfoVo
;
if
(
uid
==
null
||
null
==
(
userInfoVo
=
adamRdmService
.
getUserInfoVoByUid
(
uid
)))
{
log
.
warn
(
"###用户不存在[MOBILE:{},UID:{},TOKEN:{}]"
,
mobile
,
uid
,
CurrentUtil
.
getToken
());
return
ResponseDto
.
failure
(
"账号不存在,请确认"
);
}
AdamRealInfoVo
realInfoVoByUidPlain
=
adamRdmService
.
getRealInfoVoByUidPlain
(
uid
);
AdamUserIdentityInfoVo
userIdentityInfoVo
=
AdamUserIdentityInfoVo
.
getNew
();
userIdentityInfoVo
.
setUid
(
uid
);
userIdentityInfoVo
.
setName
(
realInfoVoByUidPlain
.
getName
());
userIdentityInfoVo
.
setMobile
(
mobile
);
return
ResponseDto
.
success
(
userIdentityInfoVo
.
desensitize
());
}
@ApiOperationSupport
(
order
=
12
)
@ApiOperation
(
value
=
"验证手机号"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号[用于验证当前账户所绑定手机号]"
),
})
@PostMapping
(
value
=
{
"check/mobile"
})
public
ResponseDto
<
Object
>
checkMobile
(
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@RequestParam
String
mobile
)
{
String
currentMobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
return
mobile
.
equals
(
currentMobile
)
?
ResponseDto
.
success
()
:
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10003"
));
}
/* ---------------------------- Internal Method ---------------------------- */
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/resources/errors.properties
View file @
ce851267
...
...
@@ -6,8 +6,8 @@
10000
=
\u
64CD
\u
4F5C
\u
8FC7
\u
4E8E
\u9891\u
7E41
\u
FF0C
\u
8BF7
\u
7A0D
\u
540E
\u
518D
\u
8BD5
10001
=
\u6388\u6743\u5931\u
8D25
10002
=
\u
9A8C
\u
8BC1
\u7801\u
53D1
\u9001\u5931\u
8D25
10003
=
\u
8BF7
\u
8F93
\u5165\u
6B63
\u
786E
\u
624B
\u
673A
\u
53F7
10004
=
\u
8BF7
\u
8F93
\u5165\u
6B63
\u
786E
\u
9A8C
\u
8BC1
\u7801
10003
=
\u
8BF7
\u
8F93
\u5165\u
6B63
\u
786E
\u
7684\u
624B
\u
673A
\u
53F7
10004
=
\u
8BF7
\u
8F93
\u5165\u
6B63
\u
786E
\u
7684\u
9A8C
\u
8BC1
\u7801
10005
=
\u
624B
\u
673A
\u
53F7
\u
83B7
\u
53D6
\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
66F4
\u6362\u
767B
\u
5F55
\u
65B9
\u
5F0F
10006
=
\u
7B2C
\u
4E09
\u
65B9
\u
8D26
\u
53F7
\u
672A
\u
6CE8
\u
518C
10007
=
\u
8BE5
\u
7B2C
\u
4E09
\u
65B9
\u
8D26
\u
53F7
\u
5DF2
\u
7ECF
\u
88AB
\u5176\u
4ED6
\u7528\u6237\u
7ED1
\u
5B9A
...
...
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