From dbf939fec1d689c7faf7a06c3d7987cb9d8d3995 Mon Sep 17 00:00:00 2001 From: kimdohyung Date: Tue, 26 Mar 2024 19:20:23 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=9D=BC=EC=B9=98=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20=ED=8C=90=EB=8B=A8=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EC=A0=9C=EA=B1=B0=20(#31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jisungin/application/review/ReviewService.java | 2 +- src/main/java/com/jisungin/domain/user/User.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/jisungin/application/review/ReviewService.java b/src/main/java/com/jisungin/application/review/ReviewService.java index d9c4942..dc2a599 100644 --- a/src/main/java/com/jisungin/application/review/ReviewService.java +++ b/src/main/java/com/jisungin/application/review/ReviewService.java @@ -47,7 +47,7 @@ public void deleteReview(Long reviewId, Long userId) { User user = userRepository.findById(userId) .orElseThrow(() -> new BusinessException(USER_NOT_FOUND)); - if (!user.isSame(reviewUser.getId())) { + if (!user.isMe(reviewUser.getId())) { throw new BusinessException(UNAUTHORIZED_REQUEST); } reviewRepository.delete(deleteReview); diff --git a/src/main/java/com/jisungin/domain/user/User.java b/src/main/java/com/jisungin/domain/user/User.java index 8be2ed2..36c7a94 100644 --- a/src/main/java/com/jisungin/domain/user/User.java +++ b/src/main/java/com/jisungin/domain/user/User.java @@ -56,8 +56,4 @@ public boolean isMe(Long userId) { return this.id.equals(userId); } - public boolean isSame(Long userId) { - return this.id.equals(userId); - } - }