diff --git a/src/main/java/io/company/localhost/controller/api/BoardController.java b/src/main/java/io/company/localhost/controller/api/BoardController.java index f0ae76e..1b96954 100644 --- a/src/main/java/io/company/localhost/controller/api/BoardController.java +++ b/src/main/java/io/company/localhost/controller/api/BoardController.java @@ -234,7 +234,16 @@ public class BoardController { @ParameterCheck @PostMapping("/{boardId}/password") public ApiResponse checkBoardPassword(@ReqMap MapDto map) { - int boardId = Integer.parseInt(map.getString("LOCBRDSEQ")); + // boardId 데이터 타입 변환 + Object boardIdObj = map.get("LOCBRDSEQ"); + int boardId = 0; + + if (boardIdObj instanceof Integer) { + boardId = (Integer) boardIdObj; + } else if (boardIdObj instanceof String) { + boardId = Integer.parseInt((String) boardIdObj); + } + String rawPassword = map.getString("LOCBRDPWD"); String storedHashedPassword = boardService.getBoardPassword(boardId); @@ -259,7 +268,15 @@ public class BoardController { @ParameterCheck @PostMapping("/comment/{commentId}/password") public ApiResponse checkCommentPassword(@ReqMap MapDto map) { - int commentId = Integer.parseInt(map.getString("LOCCMTSEQ")); + // commentId 데이터 타입 변환 + Object commentIdObj = map.get("LOCCMTSEQ"); + int commentId = 0; + + if (commentIdObj instanceof Integer) { + commentId = (Integer) commentIdObj; + } else if (commentIdObj instanceof String) { + commentId = Integer.parseInt((String) commentIdObj); + } String rawPassword = map.getString("LOCCMTPWD"); String storedHashedPassword = boardService.getCommentPassword(commentId);