장황하거나 중복 코드 구문, 코드 성숙도, 코드 스타일 이슈

This commit is contained in:
김현주
2025-07-11 14:23:49 +09:00
parent a2f03e244c
commit 1d1be83726
12 changed files with 16 additions and 28 deletions

View File

@@ -63,7 +63,7 @@ public class RoleUpdateAspect {
|| currentRoles.stream().anyMatch(item -> !beforeRoles.contains(item))) {
createLog = true;
}
} else if (currentRoles.size() > 0) {
} else if (!currentRoles.isEmpty()) {
createLog = true;
}

View File

@@ -82,7 +82,7 @@ public class AdminSecurityConfig {
List<String> permitPaths =
Arrays.stream(PublicAccess.values())
.map(PublicAccess::getPath)
.collect(Collectors.toList());
.toList();
http.authorizeHttpRequests(
(auth) ->

View File

@@ -2,10 +2,12 @@ package app.module.admin.config.application.security;
import java.util.Collection;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
@Getter
@Setter
public class AdminUser extends User {
private Long seq;
private String roleId;

View File

@@ -1,11 +1,15 @@
package app.module.admin.config.application.util.model;
import lombok.Getter;
import lombok.Setter;
import org.apache.poi.ss.usermodel.IndexedColors;
import java.util.List;
import java.util.Set;
import java.util.Map;
@Getter
@Setter
public class ExcelSheetDto {
/**
* 시트명
@@ -36,10 +40,4 @@ public class ExcelSheetDto {
this.commaColumns = commaColumns;
this.headerBgColors = headerBgColors;
}
public String getSheetName() { return sheetName; }
public List<String> getHeaders() { return headers; }
public List<List<String>> getData() { return data; }
public Set<Integer> getCommaColumns() { return commaColumns; }
public Map<Integer, IndexedColors> getHeaderBgColors() { return headerBgColors; }
}

View File

@@ -98,7 +98,7 @@ public class ExcelUtil {
wb.write(responseOutputStream);
wb.close();
} catch (IOException e) {
e.printStackTrace();
log.error("[ExcelUtil] generateWithoutPassword: {}", e.getMessage(), e);
}
}
}

View File

@@ -84,7 +84,7 @@ public class CreateCellService implements CreateCellPortIn {
// 셀 스타일 적용 (null 체크)
if (cellConfig.getCellStyle() != null) {
cell.setCellStyle(cellConfig.getCellStyle());
} else {
//} else {
// TODO: cellConfig.getCellStyle()이 null인 경우, 워크북에서 새로운 스타일을 생성하거나 기본 스타일을 적용하는 로직 고려
// XSSFWorkbook workbook = (XSSFWorkbook) sheet.getWorkbook();
// cell.setCellStyle(workbook.createCellStyle());

View File

@@ -34,9 +34,9 @@ class URICurrentMatchingService implements URICurrentMatchingPortIn {
// {{pathVar}} 을 가진 URI 라면 배열검증 수행
if (comparePath.endsWith("/{{pathVar}}")) {
List<String> pathComponents =
Arrays.stream(comparePath.split("/")).collect(Collectors.toList());
Arrays.stream(comparePath.split("/")).toList();
List<String> targetComponents =
Arrays.stream(targetUri.split("/")).collect(Collectors.toList());
Arrays.stream(targetUri.split("/")).toList();
if (pathComponents.size() != targetComponents.size()) {
return false;

View File

@@ -69,7 +69,7 @@ public class FrontSecurityConfig {
List<String> publicAccess =
Arrays.stream(PublicAccess.values())
.map(PublicAccess::getPath)
.collect(Collectors.toList());
.toList();
// front - 익명 사용자 접근 허용 URI 등록 (admin 과 달리 공개/비공개 URL 이 존재한다)
FrontPublicAccess.getInstance().setURIs(List.of("/", "/user/register", "/policy/**"));

View File

@@ -2,10 +2,12 @@ package app.module.front.config.application.security;
import java.util.Collection;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
@Getter
@Setter
public class FrontUser extends User {
private String nickname;

View File

@@ -70,7 +70,7 @@ public class DailyRecordController {
*/
@PostMapping(path = "/{searchMonth}/{groupNo}/today-none")
ResponseEntity<?> todayNone(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
, @RequestParam(name = "target", required = true, defaultValue = "") String targetType
, @RequestParam(name = "target", defaultValue = "") String targetType
, @RequestParam(name = "status", required = false, defaultValue = "N") String targetStatus) {
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);

View File

@@ -12,7 +12,6 @@ import java.util.List;
@EqualsAndHashCode
public class CreateBankInputReqVO {
// private Boolean status;
private Long id;
private String transferType;
@@ -22,9 +21,4 @@ public class CreateBankInputReqVO {
return bankList != null ? bankList : new ArrayList<>();
}
public void setBankList(List<CreateBankInputProductReqVO> bankList) {
this.bankList = bankList;
}
}

View File

@@ -11,8 +11,6 @@ import java.util.List;
@AllArgsConstructor
@EqualsAndHashCode
public class CreateMonthlyReqVO {
private Boolean status;
private Long id;
private List<CreateMonthlyProductReqVO> productList;
@@ -20,10 +18,4 @@ public class CreateMonthlyReqVO {
public List<CreateMonthlyProductReqVO> getProductList() {
return productList != null ? productList : new ArrayList<>();
}
public void setProductList(List<CreateMonthlyProductReqVO> productList) {
this.productList = productList;
}
}