mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 19:01:41 +08:00
chore: 优化部分代码
This commit is contained in:
@@ -69,7 +69,7 @@ public class OnlineUserServiceImpl implements OnlineUserService {
|
||||
})
|
||||
.map(tokenKey -> StrUtil.subAfter(tokenKey, StringConstants.COLON, true))
|
||||
.collect(Collectors.groupingBy(token -> Convert.toLong(StpUtil.getLoginIdByToken(token))));
|
||||
// 过滤 Token
|
||||
// 筛选数据
|
||||
for (Map.Entry<Long, List<String>> entry : tokenMap.entrySet()) {
|
||||
Long userId = entry.getKey();
|
||||
UserContext userContext = UserContextHolder.getContext(userId);
|
||||
|
@@ -65,8 +65,6 @@ import java.io.IOException;
|
||||
Api.EXPORT})
|
||||
public class UserController extends BaseController<UserService, UserResp, UserDetailResp, UserQuery, UserReq> {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
@Override
|
||||
public BaseIdResp<Long> add(@Validated(CrudValidationGroup.Add.class) @RequestBody UserReq req) {
|
||||
String rawPassword = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(req.getPassword()));
|
||||
@@ -81,7 +79,7 @@ public class UserController extends BaseController<UserService, UserResp, UserDe
|
||||
@SaCheckPermission("system:user:import")
|
||||
@GetMapping(value = "/import/template", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void downloadImportTemplate(HttpServletResponse response) throws IOException {
|
||||
userService.downloadImportTemplate(response);
|
||||
baseService.downloadImportTemplate(response);
|
||||
}
|
||||
|
||||
@Operation(summary = "解析导入数据", description = "解析导入数据")
|
||||
@@ -89,14 +87,14 @@ public class UserController extends BaseController<UserService, UserResp, UserDe
|
||||
@PostMapping("/import/parse")
|
||||
public UserImportParseResp parseImport(@NotNull(message = "文件不能为空") MultipartFile file) {
|
||||
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
|
||||
return userService.parseImport(file);
|
||||
return baseService.parseImport(file);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入数据", description = "导入数据")
|
||||
@SaCheckPermission("system:user:import")
|
||||
@PostMapping(value = "/import")
|
||||
public UserImportResp importUser(@Validated @RequestBody UserImportReq req) {
|
||||
return userService.importUser(req);
|
||||
return baseService.importUser(req);
|
||||
}
|
||||
|
||||
@Operation(summary = "重置密码", description = "重置用户登录密码")
|
||||
|
Reference in New Issue
Block a user