From 31e35431e7157780482352876d7a836b9ba8f3c8 Mon Sep 17 00:00:00 2001 From: leegwichan Date: Sat, 20 Jul 2024 15:17:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=98=88=EC=99=B8=EB=A5=BC=20?= =?UTF-8?q?=EC=95=84=ED=82=A4=ED=85=8D=EC=B3=90=20=EB=8B=A8=EC=9C=84?= =?UTF-8?q?=EC=9D=98=20=ED=8C=A8=ED=82=A4=EC=A7=80=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20#28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/exception/GlobalExceptionHandler.java | 2 ++ .../excpetion}/BusinessLogicException.java | 2 +- .../exception => service/excpetion}/ViolateDataException.java | 2 +- .../ddangkong/service/question/BalanceQuestionService.java | 4 ++-- .../service/question/BalanceQuestionServiceTest.java | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) rename backend/src/main/java/ddangkong/{controller/exception => service/excpetion}/BusinessLogicException.java (78%) rename backend/src/main/java/ddangkong/{controller/exception => service/excpetion}/ViolateDataException.java (78%) diff --git a/backend/src/main/java/ddangkong/controller/exception/GlobalExceptionHandler.java b/backend/src/main/java/ddangkong/controller/exception/GlobalExceptionHandler.java index 8defc993e..27def5ca9 100644 --- a/backend/src/main/java/ddangkong/controller/exception/GlobalExceptionHandler.java +++ b/backend/src/main/java/ddangkong/controller/exception/GlobalExceptionHandler.java @@ -1,5 +1,7 @@ package ddangkong.controller.exception; +import ddangkong.service.excpetion.BusinessLogicException; +import ddangkong.service.excpetion.ViolateDataException; import jakarta.validation.ConstraintViolationException; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; diff --git a/backend/src/main/java/ddangkong/controller/exception/BusinessLogicException.java b/backend/src/main/java/ddangkong/service/excpetion/BusinessLogicException.java similarity index 78% rename from backend/src/main/java/ddangkong/controller/exception/BusinessLogicException.java rename to backend/src/main/java/ddangkong/service/excpetion/BusinessLogicException.java index 85ef4f8d0..d2b522cb4 100644 --- a/backend/src/main/java/ddangkong/controller/exception/BusinessLogicException.java +++ b/backend/src/main/java/ddangkong/service/excpetion/BusinessLogicException.java @@ -1,4 +1,4 @@ -package ddangkong.controller.exception; +package ddangkong.service.excpetion; public class BusinessLogicException extends RuntimeException { diff --git a/backend/src/main/java/ddangkong/controller/exception/ViolateDataException.java b/backend/src/main/java/ddangkong/service/excpetion/ViolateDataException.java similarity index 78% rename from backend/src/main/java/ddangkong/controller/exception/ViolateDataException.java rename to backend/src/main/java/ddangkong/service/excpetion/ViolateDataException.java index 661eb660f..48192f9b1 100644 --- a/backend/src/main/java/ddangkong/controller/exception/ViolateDataException.java +++ b/backend/src/main/java/ddangkong/service/excpetion/ViolateDataException.java @@ -1,4 +1,4 @@ -package ddangkong.controller.exception; +package ddangkong.service.excpetion; public class ViolateDataException extends RuntimeException { diff --git a/backend/src/main/java/ddangkong/service/question/BalanceQuestionService.java b/backend/src/main/java/ddangkong/service/question/BalanceQuestionService.java index ca787596c..7ac45964c 100644 --- a/backend/src/main/java/ddangkong/service/question/BalanceQuestionService.java +++ b/backend/src/main/java/ddangkong/service/question/BalanceQuestionService.java @@ -1,12 +1,12 @@ package ddangkong.service.question; -import ddangkong.controller.exception.BusinessLogicException; -import ddangkong.controller.exception.ViolateDataException; import ddangkong.controller.question.dto.BalanceQuestionResponse; import ddangkong.domain.option.BalanceOption; import ddangkong.domain.option.BalanceOptionRepository; import ddangkong.domain.question.BalanceQuestion; import ddangkong.domain.question.RoomQuestionRepository; +import ddangkong.service.excpetion.BusinessLogicException; +import ddangkong.service.excpetion.ViolateDataException; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/backend/src/test/java/ddangkong/service/question/BalanceQuestionServiceTest.java b/backend/src/test/java/ddangkong/service/question/BalanceQuestionServiceTest.java index 4045a5194..3b30e2305 100644 --- a/backend/src/test/java/ddangkong/service/question/BalanceQuestionServiceTest.java +++ b/backend/src/test/java/ddangkong/service/question/BalanceQuestionServiceTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import ddangkong.controller.exception.BusinessLogicException; import ddangkong.controller.option.dto.BalanceOptionResponse; import ddangkong.controller.question.dto.BalanceQuestionResponse; import ddangkong.domain.question.Category; import ddangkong.service.BaseServiceTest; +import ddangkong.service.excpetion.BusinessLogicException; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired;