Commit 361456e7 authored by 李健华's avatar 李健华

查询判断加密手机号为空时返回null

parent b795a618
......@@ -153,6 +153,9 @@ public class UserServiceImpl implements IUserService, IBaseController {
@Override
// @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhoneInDb(String phone) {
if (StringUtils.isBlank(phone)) {
return null;
}
User user = userRepository.findByEncryptedPhoneNo(phone);
if (user == null) {
user = userRepository.findByPhoneNo(phone);
......@@ -230,6 +233,9 @@ public class UserServiceImpl implements IUserService, IBaseController {
@Override
// @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhoneWithCache(String phone) {
if (StringUtils.isBlank(phone)) {
return null;
}
User user = userRepository.findByEncryptedPhoneNo(phone);
if (user == null) {
user = userRepository.findByPhoneNo(phone);
......
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