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
f1716855
Commit
f1716855
authored
Dec 30, 2016
by
zhouqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename some method, clear the semantic
parent
be2f3610
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
19 deletions
+15
-19
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+1
-1
Jr58Controller.java
...ntgroup/xyqb/controller/external/user/Jr58Controller.java
+3
-3
SyncUserController.java
...oup/xyqb/controller/external/user/SyncUserController.java
+2
-2
UserApiController.java
...roup/xyqb/controller/external/user/UserApiController.java
+1
-2
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+2
-2
Jr58Notifier.java
...main/java/cn/quantgroup/xyqb/event/jr58/Jr58Notifier.java
+1
-1
UserApiServiceImpl.java
.../quantgroup/xyqb/service/api/impl/UserApiServiceImpl.java
+1
-1
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+2
-2
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+2
-5
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
f1716855
...
...
@@ -76,7 +76,7 @@ public class InnerController {
createdAt
=
System
.
currentTimeMillis
();
updatedAt
=
System
.
currentTimeMillis
();
}
User
user
=
userService
.
findByPhone
(
phoneNo
);
User
user
=
userService
.
findByPhone
WithCache
(
phoneNo
);
if
(
user
==
null
)
{
user
=
new
User
();
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/Jr58Controller.java
View file @
f1716855
...
...
@@ -140,7 +140,7 @@ public class Jr58Controller implements ApplicationEventPublisherAware {
String
uuid
=
jr58Service
.
register
(
param
);
applicationEventPublisher
.
publishEvent
(
new
UserinfoChangedEvent
(
this
,
uuid
,
Constants
.
Channel
.
JR58
));
User
user
=
xyqbUserService
.
findByUuid
(
uuid
);
User
user
=
xyqbUserService
.
findByUuid
WithCache
(
uuid
);
LOGGER
.
info
(
"58金融运营商授权状态更新开始"
);
try
{
jr58Service
.
getRidOfFillingProfile
(
user
,
param
.
getAccount
());
...
...
@@ -181,7 +181,7 @@ public class Jr58Controller implements ApplicationEventPublisherAware {
private
Tuple
<
String
,
User
>
getEntryPointUrl
(
String
uuid
,
String
from
)
{
// 找到uuid,但是用户不在user表中,说明是老系统用户
User
userInXyqb
=
xyqbUserService
.
findByUuid
(
uuid
);
User
userInXyqb
=
xyqbUserService
.
findByUuid
WithCache
(
uuid
);
if
(
userInXyqb
!=
null
)
{
String
token
=
authApiService
.
login
(
userInXyqb
.
getPhoneNo
(),
Constants
.
Channel
.
JR58
);
...
...
@@ -196,7 +196,7 @@ public class Jr58Controller implements ApplicationEventPublisherAware {
LOGGER
.
error
(
"58金融运营商授权数据导入接口 - uuid对应的UuidPhoneMapping为空"
);
}
// 手机号在新系统中存在,说明之前已经注册过
userInXyqb
=
xyqbUserService
.
findByPhone
(
phoneNo
);
userInXyqb
=
xyqbUserService
.
findByPhone
WithCache
(
phoneNo
);
if
(
userInXyqb
!=
null
)
{
String
token
=
authApiService
.
login
(
phoneNo
,
Constants
.
Channel
.
JR58
);
return
new
Tuple
<>(
String
.
format
(
ENTRY_POINT_URL_TEMPLATE
,
xyqbUrl
,
token
),
userInXyqb
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/SyncUserController.java
View file @
f1716855
...
...
@@ -58,7 +58,7 @@ public class SyncUserController {
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
String
phoneNo
=
userDetail
.
getPhoneNo
();
User
user
=
userService
.
findByPhone
(
phoneNo
);
User
user
=
userService
.
findByPhone
WithCache
(
phoneNo
);
if
(
null
==
user
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
...
...
@@ -76,7 +76,7 @@ public class SyncUserController {
if
(
StringUtils
.
isEmpty
(
uuid
))
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
User
user
=
userService
.
findByUuid
(
uuid
);
User
user
=
userService
.
findByUuid
WithCache
(
uuid
);
if
(
null
==
user
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/UserApiController.java
View file @
f1716855
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
.
user
;
import
cn.quantgroup.sms.SmsSender
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.api.IUserApiService
;
...
...
@@ -50,7 +49,7 @@ public class UserApiController {
if
(!
"abc1234"
.
equals
(
key
)
||
StringUtils
.
isEmpty
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
User
user
=
userService
.
findByPhone
(
phoneNo
);
User
user
=
userService
.
findByPhone
WithCache
(
phoneNo
);
if
(
null
==
user
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
f1716855
...
...
@@ -82,7 +82,7 @@ public class UserController implements IBaseController {
}
String
userName
=
credentialArr
[
0
];
String
pass
=
credentialArr
[
1
];
User
user
=
userService
.
findByPhone
(
userName
);
User
user
=
userService
.
findByPhone
WithCache
(
userName
);
if
(
user
==
null
){
return
JsonResult
.
buildErrorStateResult
(
"用户名或密码不正确"
,
null
);
}
...
...
@@ -175,7 +175,7 @@ public class UserController implements IBaseController {
LOGGER
.
info
(
"用户快速登录,验证码校验失败,phoneNo:{} , verificationCode:{}"
,
phoneNo
,
verificationCode
);
return
JsonResult
.
buildErrorStateResult
(
"验证码错误"
,
null
);
}
User
user
=
userService
.
findByPhone
(
phoneNo
);
User
user
=
userService
.
findByPhone
WithCache
(
phoneNo
);
if
(
user
==
null
){
user
=
registerFastWhenLogin
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
);
if
(
user
==
null
)
{
...
...
src/main/java/cn/quantgroup/xyqb/event/jr58/Jr58Notifier.java
View file @
f1716855
...
...
@@ -32,7 +32,7 @@ public class Jr58Notifier implements ApplicationListener<UserinfoChangedEvent> {
return
;
}
User
user
=
userService
.
findByUuid
(
uuid
);
User
user
=
userService
.
findByUuid
WithCache
(
uuid
);
if
(
user
==
null
||
user
.
getRegisteredFrom
()
!=
Constants
.
Channel
.
JR58
)
{
return
;
}
...
...
src/main/java/cn/quantgroup/xyqb/service/api/impl/UserApiServiceImpl.java
View file @
f1716855
...
...
@@ -24,7 +24,7 @@ public class UserApiServiceImpl implements IUserApiService {
@Override
public
boolean
userImportCheck
(
String
phoneNo
)
{
User
user
=
userService
.
findByPhone
(
phoneNo
);
User
user
=
userService
.
findByPhone
WithCache
(
phoneNo
);
if
(
user
!=
null
){
return
false
;
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
f1716855
...
...
@@ -7,9 +7,9 @@ import cn.quantgroup.xyqb.entity.User;
*/
public
interface
IUserService
{
User
findByPhone
(
String
phone
);
User
findByPhone
WithCache
(
String
phone
);
User
findByUuid
(
String
uuid
);
User
findByUuid
WithCache
(
String
uuid
);
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
userIp
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
f1716855
...
...
@@ -2,8 +2,6 @@ package cn.quantgroup.xyqb.service.user.impl;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.repository.IUserDetailRepository
;
import
cn.quantgroup.xyqb.repository.IUserRepository
;
import
cn.quantgroup.xyqb.service.sms.ISmsService
;
import
cn.quantgroup.xyqb.service.user.ILkbUserService
;
...
...
@@ -39,7 +37,6 @@ public class UserServiceImpl implements IUserService {
private
ISmsService
smsService
;
@Override
@Cacheable
(
value
=
"usercache"
,
key
=
"'xyqbuser' + #phone"
,
unless
=
"#result == null"
,
cacheManager
=
"cacheManager"
)
public
User
findByPhoneInDb
(
String
phone
)
{
return
userRepository
.
findByPhoneNo
(
phone
);
}
...
...
@@ -79,13 +76,13 @@ public class UserServiceImpl implements IUserService {
@Override
@Cacheable
(
value
=
"usercache"
,
key
=
"'xyqbuser' + #phone"
,
unless
=
"#result == null"
,
cacheManager
=
"cacheManager"
)
public
User
findByPhone
(
String
phone
)
{
public
User
findByPhone
WithCache
(
String
phone
)
{
return
userRepository
.
findByPhoneNo
(
phone
);
}
@Override
@Cacheable
(
value
=
"usercache"
,
key
=
"'xyqbuser' + #uuid"
,
unless
=
"#result == null"
,
cacheManager
=
"cacheManager"
)
public
User
findByUuid
(
String
uuid
)
{
public
User
findByUuid
WithCache
(
String
uuid
)
{
return
userRepository
.
findByUuid
(
uuid
);
}
...
...
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