Commit e56e5d97 authored by shiyu's avatar shiyu

登录后返回手机号,缓存查询更改为玩物得志接口

parent 615ce4b8
......@@ -132,11 +132,11 @@ public class CacheUtil {
* @return
*/
public String getAppletUserList(long key) {
/* User user = dtsUserDao.findById(key);
return user.getNickname();*/
List<User> userList = dtsUserDao.findAll();
User user = dtsUserDao.findById(key);
return user.getNickname();
/* List<User> userList = dtsUserDao.findAll();
Map<Long, String> map = userList.stream().collect(Collectors.toMap(User::getId, User::getNickname, (k1, k2) -> k2));
return map.get(key);
return map.get(key);*/
}
/* public String getAppletUserList(long key) {
......@@ -151,11 +151,11 @@ public class CacheUtil {
* @return
*/
public User getAppletUsers(long key) {
/* User user = dtsUserDao.findById(key);
return user;*/
List<User> userList = dtsUserDao.findAll();
User user = dtsUserDao.findById(key);
return user;
/* List<User> userList = dtsUserDao.findAll();
Map<Long, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity(), (k1, k2) -> k2));
return map.get(key);
return map.get(key);*/
}
/**
......
......@@ -210,6 +210,7 @@ public class UserServiceImpl implements UserService {
result.put("isInvited", true);
User user = userDao.queryById(dto.getUserId());
logger.info("登录用户的信息:{}", JsonUtils.from(user));
result.put("phone", user.getMobile());
// 缓存用户信息
String userKey = MessageFormat.format(CacheCodeConstants.USER_INFO_KEY, user.getId());
redisUtil.set(userKey, user, 2 * 60 * 60);
......
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