From 7eadc3dd3f16adebb7f8585092faddcb614f3611 Mon Sep 17 00:00:00 2001 From: ziiyouth Date: Tue, 5 Dec 2023 16:36:32 +0900 Subject: [PATCH 1/3] fix: modifying exception handling --- src/main/java/com/hadam/hadam/repository/DiaryRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hadam/hadam/repository/DiaryRepository.java b/src/main/java/com/hadam/hadam/repository/DiaryRepository.java index 6d0ffcf..561da2a 100644 --- a/src/main/java/com/hadam/hadam/repository/DiaryRepository.java +++ b/src/main/java/com/hadam/hadam/repository/DiaryRepository.java @@ -1,14 +1,14 @@ package com.hadam.hadam.repository; import com.hadam.hadam.domain.Diary; +import com.hadam.hadam.global.error.exception.EntityNotFoundException; import com.hadam.hadam.global.error.exception.ErrorCode; -import jakarta.persistence.EntityNotFoundException; import org.springframework.data.jpa.repository.JpaRepository; public interface DiaryRepository extends JpaRepository { default Diary findByIdOrThrow(Long diaryId){ return findById(diaryId) - .orElseThrow(()-> new EntityNotFoundException(String.valueOf(ErrorCode.ENTITY_NOT_FOUND))); + .orElseThrow(()-> new EntityNotFoundException(ErrorCode.ENTITY_NOT_FOUND)); } } From bf4e08794810fab5f217f3629840ebe264f599e5 Mon Sep 17 00:00:00 2001 From: ziiyouth Date: Fri, 8 Dec 2023 21:22:27 +0900 Subject: [PATCH 2/3] fix: health check message --- src/main/java/com/hadam/hadam/global/check/CheckController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hadam/hadam/global/check/CheckController.java b/src/main/java/com/hadam/hadam/global/check/CheckController.java index 7b2aab8..321680a 100644 --- a/src/main/java/com/hadam/hadam/global/check/CheckController.java +++ b/src/main/java/com/hadam/hadam/global/check/CheckController.java @@ -8,7 +8,7 @@ public class CheckController { @GetMapping("/api/check") public String check() { - return "Ok!"; + return "Hadam Ok!"; } } From 381264f716af8e4c3c5780826dcbe00bc13ca9b7 Mon Sep 17 00:00:00 2001 From: ziiyouth Date: Fri, 8 Dec 2023 21:28:17 +0900 Subject: [PATCH 3/3] feat: Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5ffd166 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:17 +COPY ./build/libs/hadam-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java", "-jar", "app.jar"] \ No newline at end of file