Commit e4637ce4 authored by lee_mingzhu's avatar lee_mingzhu

change something

parent 26ab629e
......@@ -74,7 +74,7 @@ public class AppController implements IBaseController {
}
String requestIp = IPUtil.getRemoteIP(request);
LOGGER.info("第三方用户登录, loginFrom:{}, requestIp:{}", registerFrom, requestIp);
User user = userService.findByPhone(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if (user == null) {
user = register(registerFrom, phoneNo, idNo, name);
}
......
......@@ -37,7 +37,7 @@ public class InnerController {
@RequestMapping("/user/search/phoneNo")
public JsonResult findByPhoneNo(String phoneNo) {
User user = userService.findByPhoneInDb(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if (user == null) {
return JsonResult.buildErrorStateResult("", null);
}
......
......@@ -196,7 +196,7 @@ public class Jr58Controller implements ApplicationEventPublisherAware {
LOGGER.error("58金融运营商授权数据导入接口 - uuid对应的UuidPhoneMapping为空");
}
// 手机号在新系统中存在,说明之前已经注册过
userInXyqb = xyqbUserService.findByPhone(phoneNo);
userInXyqb = xyqbUserService.findByPhoneInRedisIfExist(phoneNo);
if (userInXyqb != null) {
String token = authApiService.login(phoneNo, Constants.Channel.JR58);
return new Tuple<>(String.format(ENTRY_POINT_URL_TEMPLATE, xyqbUrl, token), userInXyqb);
......
......@@ -39,7 +39,7 @@ public class SyncUserController {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
}
User user = userService.findByPhone(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if (null == user) {
return JsonResult.buildErrorStateResult(null, null);
}
......@@ -58,7 +58,7 @@ public class SyncUserController {
return JsonResult.buildErrorStateResult(null, null);
}
String phoneNo = userDetail.getPhoneNo();
User user = userService.findByPhone(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if (null == user) {
return JsonResult.buildErrorStateResult(null, null);
}
......
......@@ -50,7 +50,7 @@ public class UserApiController {
if (!"abc1234".equals(key) || StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
}
User user = userService.findByPhone(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if (null == user) {
return JsonResult.buildErrorStateResult(null, null);
}
......
......@@ -97,7 +97,7 @@ public class UserController implements IBaseController {
}
String userName = credentialArr[0];
String pass = credentialArr[1];
User user = userService.findByPhone(userName);
User user = userService.findByPhoneInRedisIfExist(userName);
if(user == null){
return JsonResult.buildErrorStateResult("用户名或密码不正确", null);
}
......@@ -190,7 +190,7 @@ public class UserController implements IBaseController {
LOGGER.info("用户快速登录,验证码校验失败,phoneNo:{} , verificationCode:{}", phoneNo, verificationCode);
return JsonResult.buildErrorStateResult("验证码错误", null);
}
User user = userService.findByPhone(phoneNo);
User user = userService.findByPhoneInRedisIfExist(phoneNo);
if(user == null){
user = registerFastWhenLogin(phoneNo, channelId, createdFrom, appChannel);
if (user == null) {
......
......@@ -7,7 +7,7 @@ import cn.quantgroup.xyqb.entity.User;
*/
public interface IUserService {
User findByPhone(String phone);
//User findByPhone(String phone);
User findByUuid(String uuid);
......@@ -19,7 +19,7 @@ public interface IUserService {
boolean resetPassword(String phoneNo, String password);
User findByPhoneInDb(String phone);
User findByPhoneInRedisIfExist(String phone);
User findByUuidInDb(String uuid);
......
......@@ -40,7 +40,7 @@ public class UserServiceImpl implements IUserService {
@Override
@Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhoneInDb(String phone) {
public User findByPhoneInRedisIfExist(String phone) {
return userRepository.findByPhoneNo(phone);
}
......@@ -77,13 +77,14 @@ public class UserServiceImpl implements IUserService {
}
@Override
/*@Override
@Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhone(String phone) {
return userRepository.findByPhoneNo(phone);
}
}*/
@Override
@Cacheable(value = "usercache", key = "'xyqbuser' + #uuid", unless = "#result == null", cacheManager = "cacheManager")
public User findByUuid(String uuid) {
return userRepository.findByUuid(uuid);
}
......
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