Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
00d4cc8f
Commit
00d4cc8f
authored
Feb 27, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码容错
parent
f05a82ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+8
-4
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+5
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
00d4cc8f
...
@@ -295,11 +295,15 @@ public class InnerController implements IBaseController {
...
@@ -295,11 +295,15 @@ public class InnerController implements IBaseController {
@LogHttpCaller
@LogHttpCaller
@RequestMapping
(
"/user_detail/search/userId"
)
@RequestMapping
(
"/user_detail/search/userId"
)
public
JsonResult
findUserDetailByUserId
(
Long
userId
)
{
public
JsonResult
findUserDetailByUserId
(
Long
userId
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserDetail
userDetail
=
null
;
if
(
userDetail
!=
null
)
{
// 增加容错性,防备DB中存在的脏数据触发异常
return
JsonResult
.
buildSuccessResult
(
null
,
UserDetailRet
.
getUserDetail
(
userDetail
));
if
(
userId
!=
null
&&
userId
>
0
){
userDetail
=
userDetailService
.
findByUserId
(
userId
);
}
}
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
if
(
Objects
.
isNull
(
userDetail
))
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
UserDetailRet
.
getUserDetail
(
userDetail
));
}
}
@LogHttpCaller
@LogHttpCaller
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
00d4cc8f
...
@@ -181,13 +181,17 @@ public class UserController implements IBaseController {
...
@@ -181,13 +181,17 @@ public class UserController implements IBaseController {
JsonResult
successResult
=
validMap
.
get
(
"success"
);
JsonResult
successResult
=
validMap
.
get
(
"success"
);
String
phoneNo
=
successResult
.
getData
().
toString
();
String
phoneNo
=
successResult
.
getData
().
toString
();
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
LOGGER
.
info
(
"用户快速
注册
失败,手机号错误, createdFrom:{},phoneNo:{}"
,
createdFrom
,
phoneNo
);
LOGGER
.
info
(
"用户快速
登录
失败,手机号错误, createdFrom:{},phoneNo:{}"
,
createdFrom
,
phoneNo
);
throw
new
UserNotExistException
(
"手机号错误"
);
throw
new
UserNotExistException
(
"手机号错误"
);
}
}
String
verificationCode
=
successResult
.
getMsg
();
String
verificationCode
=
successResult
.
getMsg
();
// 执行短信验证码检查
// 执行短信验证码检查
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
// 缓存未命中时查DB
if
(
user
==
null
)
{
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
}
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
...
...
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