refactor: remove unused imports and fields
This commit is contained in:
@@ -209,7 +209,6 @@ public class DepartmentView {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
private String treePath;
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
private Status status;
|
private Status status;
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
@@ -233,11 +232,6 @@ public class DepartmentView {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepartmentViewBuilder treePath(String treePath) {
|
|
||||||
this.treePath = treePath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DepartmentViewBuilder sort(Integer sort) {
|
public DepartmentViewBuilder sort(Integer sort) {
|
||||||
this.sort = sort;
|
this.sort = sort;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
-1
@@ -2,7 +2,6 @@ package com.onixbyte.helix.security.entrypoint;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.onixbyte.helix.domain.web.response.BizExceptionResponse;
|
import com.onixbyte.helix.domain.web.response.BizExceptionResponse;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.onixbyte.helix.service;
|
|||||||
import com.onixbyte.helix.domain.entity.Setting;
|
import com.onixbyte.helix.domain.entity.Setting;
|
||||||
import com.onixbyte.helix.domain.entity.User;
|
import com.onixbyte.helix.domain.entity.User;
|
||||||
import com.onixbyte.helix.domain.web.request.LoginRequest;
|
import com.onixbyte.helix.domain.web.request.LoginRequest;
|
||||||
import com.onixbyte.helix.enumeration.ApplicationMode;
|
|
||||||
import com.onixbyte.helix.exception.BizException;
|
import com.onixbyte.helix.exception.BizException;
|
||||||
import com.onixbyte.helix.manager.ApplicationManager;
|
import com.onixbyte.helix.manager.ApplicationManager;
|
||||||
import com.onixbyte.helix.manager.CaptchaManager;
|
import com.onixbyte.helix.manager.CaptchaManager;
|
||||||
@@ -104,12 +103,8 @@ public class AuthService {
|
|||||||
|
|
||||||
var applicationMode = applicationManager.getApplicationMode();
|
var applicationMode = applicationManager.getApplicationMode();
|
||||||
switch (applicationMode) {
|
switch (applicationMode) {
|
||||||
case PRODUCTION -> {
|
case PRODUCTION -> cookieBuilder.httpOnly(true);
|
||||||
cookieBuilder.httpOnly(true);
|
case DEVELOPMENT -> cookieBuilder.sameSite("NONE");
|
||||||
}
|
|
||||||
case DEVELOPMENT -> {
|
|
||||||
cookieBuilder.sameSite("NONE");
|
|
||||||
}
|
|
||||||
case null, default -> {
|
case null, default -> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,14 +12,11 @@ import com.onixbyte.helix.domain.web.request.ResetPasswordRequest;
|
|||||||
import com.onixbyte.helix.domain.web.request.EditUserRequest;
|
import com.onixbyte.helix.domain.web.request.EditUserRequest;
|
||||||
import com.onixbyte.helix.domain.web.response.UserDetailResponse;
|
import com.onixbyte.helix.domain.web.response.UserDetailResponse;
|
||||||
import com.onixbyte.helix.manager.*;
|
import com.onixbyte.helix.manager.*;
|
||||||
import com.onixbyte.helix.mapper.UserCredentialMapper;
|
|
||||||
import com.onixbyte.helix.repository.UserCredentialRepository;
|
|
||||||
import com.onixbyte.identitygenerator.IdentityGenerator;
|
import com.onixbyte.identitygenerator.IdentityGenerator;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
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;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -33,12 +30,9 @@ public class UserService {
|
|||||||
private final IdentityGenerator<Long> userIdentityGenerator;
|
private final IdentityGenerator<Long> userIdentityGenerator;
|
||||||
private final RoleManager roleManager;
|
private final RoleManager roleManager;
|
||||||
private final UserRoleManager userRoleManager;
|
private final UserRoleManager userRoleManager;
|
||||||
private final PasswordEncoder passwordEncoder;
|
|
||||||
private final ApplicationManager applicationManager;
|
private final ApplicationManager applicationManager;
|
||||||
private final DepartmentManager departmentManager;
|
private final DepartmentManager departmentManager;
|
||||||
private final PositionManager positionManager;
|
private final PositionManager positionManager;
|
||||||
private final UserCredentialRepository userCredentialRepository;
|
|
||||||
private final UserCredentialMapper userCredentialMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public UserService(
|
public UserService(
|
||||||
@@ -46,21 +40,17 @@ public class UserService {
|
|||||||
IdentityGenerator<Long> userIdentityGenerator,
|
IdentityGenerator<Long> userIdentityGenerator,
|
||||||
RoleManager roleManager,
|
RoleManager roleManager,
|
||||||
UserRoleManager userRoleManager,
|
UserRoleManager userRoleManager,
|
||||||
PasswordEncoder passwordEncoder,
|
|
||||||
ApplicationManager applicationManager,
|
ApplicationManager applicationManager,
|
||||||
DepartmentManager departmentManager,
|
DepartmentManager departmentManager,
|
||||||
PositionManager positionManager,
|
PositionManager positionManager
|
||||||
UserCredentialRepository userCredentialRepository, UserCredentialMapper userCredentialMapper) {
|
) {
|
||||||
this.userManager = userManager;
|
this.userManager = userManager;
|
||||||
this.userIdentityGenerator = userIdentityGenerator;
|
this.userIdentityGenerator = userIdentityGenerator;
|
||||||
this.roleManager = roleManager;
|
this.roleManager = roleManager;
|
||||||
this.userRoleManager = userRoleManager;
|
this.userRoleManager = userRoleManager;
|
||||||
this.passwordEncoder = passwordEncoder;
|
|
||||||
this.applicationManager = applicationManager;
|
this.applicationManager = applicationManager;
|
||||||
this.departmentManager = departmentManager;
|
this.departmentManager = departmentManager;
|
||||||
this.positionManager = positionManager;
|
this.positionManager = positionManager;
|
||||||
this.userCredentialRepository = userCredentialRepository;
|
|
||||||
this.userCredentialMapper = userCredentialMapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<UserDetailResponse> queryUserDetailsPage(Pageable pageable, QueryUserRequest request) {
|
public Page<UserDetailResponse> queryUserDetailsPage(Pageable pageable, QueryUserRequest request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user