refactor: 调整 starter 内的 CommonUserService、ContainerPool 到 admin 项目

This commit is contained in:
2025-01-09 21:28:14 +08:00
parent ee46e47361
commit f1d0b491b1
6 changed files with 57 additions and 16 deletions

View File

@@ -54,6 +54,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import top.continew.admin.auth.service.OnlineUserService;
import top.continew.admin.common.base.CommonUserService;
import top.continew.admin.common.constant.CacheConstants;
import top.continew.admin.common.constant.SysConstants;
import top.continew.admin.common.context.UserContext;
@@ -82,7 +83,6 @@ import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
import top.continew.starter.extension.crud.service.BaseServiceImpl;
import top.continew.starter.extension.crud.service.CommonUserService;
import top.continew.starter.web.util.FileUploadUtils;
import java.io.IOException;
@@ -209,6 +209,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
ids.forEach(onlineUserService::kickOut);
}
@Override
@Cached(key = "#id", name = CacheConstants.USER_KEY_PREFIX, cacheType = CacheType.BOTH, syncLocal = true)
public String getNicknameById(Long id) {
return baseMapper.selectNicknameById(id);
}
@Override
public void downloadImportTemplate(HttpServletResponse response) throws IOException {
try {
@@ -462,12 +468,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
return baseMapper.lambdaQuery().in(UserDO::getDeptId, deptIds).count();
}
@Override
@Cached(key = "#id", name = CacheConstants.USER_KEY_PREFIX, cacheType = CacheType.BOTH, syncLocal = true)
public String getNicknameById(Long id) {
return baseMapper.selectNicknameById(id);
}
@Override
protected <E> List<E> list(UserQuery query, SortQuery sortQuery, Class<E> targetClass) {
QueryWrapper<UserDO> queryWrapper = this.buildQueryWrapper(query);