refactor: remove unused logger imports and related fields from manager and controller classes

This commit is contained in:
siujamo
2026-03-23 15:45:11 +08:00
parent 69e3f84bec
commit 8b343af4e8
12 changed files with 8 additions and 39 deletions
@@ -6,8 +6,6 @@ import com.onixbyte.helix.service.AuthService;
import com.onixbyte.helix.service.TokenService; import com.onixbyte.helix.service.TokenService;
import com.onixbyte.helix.service.UserService; import com.onixbyte.helix.service.UserService;
import com.onixbyte.helix.shared.TokenConstant; import com.onixbyte.helix.shared.TokenConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -27,7 +25,6 @@ import java.time.Duration;
@RequestMapping("/auth") @RequestMapping("/auth")
public class AuthController { public class AuthController {
private static final Logger log = LoggerFactory.getLogger(AuthController.class);
private final AuthService authService; private final AuthService authService;
private final TokenService tokenService; private final TokenService tokenService;
private final UserService userService; private final UserService userService;
@@ -1,6 +1,5 @@
package com.onixbyte.helix.domain.web.request; package com.onixbyte.helix.domain.web.request;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Pattern;
@@ -2,7 +2,6 @@ package com.onixbyte.helix.manager;
import com.onixbyte.helix.shared.CacheName; import com.onixbyte.helix.shared.CacheName;
import com.onixbyte.helix.domain.entity.Asset; import com.onixbyte.helix.domain.entity.Asset;
import com.onixbyte.helix.mapper.AssetMapper;
import com.onixbyte.helix.repository.AssetRepository; import com.onixbyte.helix.repository.AssetRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
@@ -13,12 +12,10 @@ import org.springframework.stereotype.Component;
@Component @Component
public class AssetManager { public class AssetManager {
private final AssetMapper assetMapper;
private final AssetRepository assetRepository; private final AssetRepository assetRepository;
@Autowired @Autowired
public AssetManager(AssetMapper assetMapper, AssetRepository assetRepository) { public AssetManager(AssetRepository assetRepository) {
this.assetMapper = assetMapper;
this.assetRepository = assetRepository; this.assetRepository = assetRepository;
} }
@@ -8,8 +8,6 @@ import com.onixbyte.helix.exception.BizException;
import com.onixbyte.helix.mapper.AuthorityMapper; import com.onixbyte.helix.mapper.AuthorityMapper;
import com.onixbyte.helix.repository.AuthorityRepository; import com.onixbyte.helix.repository.AuthorityRepository;
import com.onixbyte.helix.shared.CacheName; import com.onixbyte.helix.shared.CacheName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Example; import org.springframework.data.domain.Example;
@@ -25,7 +23,6 @@ import java.util.Optional;
@Component @Component
public class AuthorityManager { public class AuthorityManager {
private static final Logger log = LoggerFactory.getLogger(AuthorityManager.class);
private final AuthorityMapper authorityMapper; private final AuthorityMapper authorityMapper;
private final AuthorityRepository authorityRepository; private final AuthorityRepository authorityRepository;
@@ -1,7 +1,6 @@
package com.onixbyte.helix.manager; package com.onixbyte.helix.manager;
import com.onixbyte.helix.domain.entity.Department; import com.onixbyte.helix.domain.entity.Department;
import com.onixbyte.helix.mapper.DepartmentMapper;
import com.onixbyte.helix.repository.DepartmentRepository; import com.onixbyte.helix.repository.DepartmentRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -13,12 +12,10 @@ import java.util.Optional;
@Component @Component
public class DepartmentManager { public class DepartmentManager {
private final DepartmentMapper departmentMapper;
private final DepartmentRepository departmentRepository; private final DepartmentRepository departmentRepository;
@Autowired @Autowired
public DepartmentManager(DepartmentMapper departmentMapper, DepartmentRepository departmentRepository) { public DepartmentManager(DepartmentRepository departmentRepository) {
this.departmentMapper = departmentMapper;
this.departmentRepository = departmentRepository; this.departmentRepository = departmentRepository;
} }
@@ -2,8 +2,6 @@ package com.onixbyte.helix.manager;
import com.onixbyte.helix.domain.entity.Menu; import com.onixbyte.helix.domain.entity.Menu;
import com.onixbyte.helix.mapper.MenuMapper; import com.onixbyte.helix.mapper.MenuMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -11,7 +9,7 @@ import java.util.List;
@Component @Component
public class MenuManager { public class MenuManager {
private static final Logger log = LoggerFactory.getLogger(MenuManager.class);
private final MenuMapper menuMapper; private final MenuMapper menuMapper;
@Autowired @Autowired
@@ -1,7 +1,6 @@
package com.onixbyte.helix.manager; package com.onixbyte.helix.manager;
import com.onixbyte.helix.domain.entity.Position; import com.onixbyte.helix.domain.entity.Position;
import com.onixbyte.helix.mapper.PositionMapper;
import com.onixbyte.helix.repository.PositionRepository; import com.onixbyte.helix.repository.PositionRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -11,12 +10,10 @@ import org.springframework.stereotype.Component;
@Component @Component
public class PositionManager { public class PositionManager {
private final PositionMapper positionMapper;
private final PositionRepository positionRepository; private final PositionRepository positionRepository;
@Autowired @Autowired
public PositionManager(PositionMapper positionMapper, PositionRepository positionRepository) { public PositionManager(PositionRepository positionRepository) {
this.positionMapper = positionMapper;
this.positionRepository = positionRepository; this.positionRepository = positionRepository;
} }
@@ -1,7 +1,6 @@
package com.onixbyte.helix.manager; package com.onixbyte.helix.manager;
import com.onixbyte.helix.mapper.RoleAuthorityMapper; import com.onixbyte.helix.mapper.RoleAuthorityMapper;
import com.onixbyte.helix.repository.RoleAuthorityRepository;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -10,11 +9,9 @@ import org.springframework.stereotype.Component;
public class RoleAuthorityManager { public class RoleAuthorityManager {
private static final Logger log = LoggerFactory.getLogger(RoleAuthorityManager.class); private static final Logger log = LoggerFactory.getLogger(RoleAuthorityManager.class);
private final RoleAuthorityRepository roleAuthorityRepository;
private final RoleAuthorityMapper roleAuthorityMapper; private final RoleAuthorityMapper roleAuthorityMapper;
public RoleAuthorityManager(RoleAuthorityRepository roleAuthorityRepository, RoleAuthorityMapper roleAuthorityMapper) { public RoleAuthorityManager(RoleAuthorityMapper roleAuthorityMapper) {
this.roleAuthorityRepository = roleAuthorityRepository;
this.roleAuthorityMapper = roleAuthorityMapper; this.roleAuthorityMapper = roleAuthorityMapper;
} }
@@ -3,7 +3,6 @@ package com.onixbyte.helix.manager;
import com.onixbyte.helix.domain.database.query.wrapper.QueryRoleWrapper; import com.onixbyte.helix.domain.database.query.wrapper.QueryRoleWrapper;
import com.onixbyte.helix.domain.entity.Role; import com.onixbyte.helix.domain.entity.Role;
import com.onixbyte.helix.exception.BizException; import com.onixbyte.helix.exception.BizException;
import com.onixbyte.helix.mapper.RoleAuthorityMapper;
import com.onixbyte.helix.mapper.RoleMapper; import com.onixbyte.helix.mapper.RoleMapper;
import com.onixbyte.helix.repository.RoleRepository; import com.onixbyte.helix.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -20,13 +19,11 @@ public class RoleManager {
private final RoleMapper roleMapper; private final RoleMapper roleMapper;
private final RoleRepository roleRepository; private final RoleRepository roleRepository;
private final RoleAuthorityMapper roleAuthorityMapper;
@Autowired @Autowired
public RoleManager(RoleMapper roleMapper, RoleRepository roleRepository, RoleAuthorityMapper roleAuthorityMapper) { public RoleManager(RoleMapper roleMapper, RoleRepository roleRepository) {
this.roleMapper = roleMapper; this.roleMapper = roleMapper;
this.roleRepository = roleRepository; this.roleRepository = roleRepository;
this.roleAuthorityMapper = roleAuthorityMapper;
} }
public void validateRoles(List<Long> roleIds) { public void validateRoles(List<Long> roleIds) {
@@ -1,8 +1,6 @@
package com.onixbyte.helix.manager; package com.onixbyte.helix.manager;
import com.onixbyte.helix.domain.entity.UserRole; import com.onixbyte.helix.domain.entity.UserRole;
import com.onixbyte.helix.domain.entity.embeddable.UserRoleId;
import com.onixbyte.helix.mapper.UserRoleMapper;
import com.onixbyte.helix.repository.UserRoleRepository; import com.onixbyte.helix.repository.UserRoleRepository;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -15,12 +13,10 @@ import java.util.List;
public class UserRoleManager { public class UserRoleManager {
private static final Logger log = LoggerFactory.getLogger(UserRoleManager.class); private static final Logger log = LoggerFactory.getLogger(UserRoleManager.class);
private final UserRoleMapper userRoleMapper;
private final UserRoleRepository userRoleRepository; private final UserRoleRepository userRoleRepository;
@Autowired @Autowired
public UserRoleManager(UserRoleMapper userRoleMapper, UserRoleRepository userRoleRepository) { public UserRoleManager(UserRoleRepository userRoleRepository) {
this.userRoleMapper = userRoleMapper;
this.userRoleRepository = userRoleRepository; this.userRoleRepository = userRoleRepository;
} }
@@ -3,7 +3,6 @@ package com.onixbyte.helix.repository;
import com.onixbyte.helix.domain.entity.Authority; import com.onixbyte.helix.domain.entity.Authority;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository
@@ -5,8 +5,6 @@ import com.onixbyte.helix.domain.common.TreeNode;
import com.onixbyte.helix.manager.MenuManager; import com.onixbyte.helix.manager.MenuManager;
import com.onixbyte.helix.utils.SecurityUtil; import com.onixbyte.helix.utils.SecurityUtil;
import com.onixbyte.helix.utils.TreeUtil; import com.onixbyte.helix.utils.TreeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -14,7 +12,7 @@ import java.util.List;
@Service @Service
public class MenuService { public class MenuService {
private static final Logger log = LoggerFactory.getLogger(MenuService.class);
private final MenuManager menuManager; private final MenuManager menuManager;
@Autowired @Autowired