Commit d11e61c6 by HlQ

[chg] 用户同步到 Redis,同步所有用户

1 parent 397cc518
...@@ -28,7 +28,6 @@ import vion.service.IUserService; ...@@ -28,7 +28,6 @@ import vion.service.IUserService;
import vion.vo.RoleVO; import vion.vo.RoleVO;
import vion.vo.UserVO; import vion.vo.UserVO;
import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -104,7 +103,7 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem ...@@ -104,7 +103,7 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
@Override @Override
public void syncUser() { public void syncUser() {
Opt.ofEmptyAble(this.lambdaQuery().ge(User::getModifyTime, LocalDate.now()).list()) Opt.ofEmptyAble(this.lambdaQuery().list())
.ifPresent(l -> l.forEach(user -> { .ifPresent(l -> l.forEach(user -> {
redissonClient.getBucket(RedisKeyEnum.DING_PREFIX.getVal() + RedisKeyEnum.USER_ID.getVal() + user.getId()).set(user); redissonClient.getBucket(RedisKeyEnum.DING_PREFIX.getVal() + RedisKeyEnum.USER_ID.getVal() + user.getId()).set(user);
redissonClient.getBucket(RedisKeyEnum.DING_PREFIX.getVal() + RedisKeyEnum.USER_NAME.getVal() + user.getUsername()).set(user); redissonClient.getBucket(RedisKeyEnum.DING_PREFIX.getVal() + RedisKeyEnum.USER_NAME.getVal() + user.getUsername()).set(user);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!