From 3c5d0486835c028276d3ee9ef15de9d1d3b4951e Mon Sep 17 00:00:00 2001 From: hawardShin Date: Sun, 24 Nov 2024 03:50:31 +0900 Subject: [PATCH 1/3] Fix: Solution Jpa --- .../java/com/jojoidu/book/easy/practice/entity/Solution.java | 2 +- .../book/easy/practice/repository/SolutionRepository.java | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/jojoidu/book/easy/practice/entity/Solution.java b/src/main/java/com/jojoidu/book/easy/practice/entity/Solution.java index b1e09ad..0753305 100644 --- a/src/main/java/com/jojoidu/book/easy/practice/entity/Solution.java +++ b/src/main/java/com/jojoidu/book/easy/practice/entity/Solution.java @@ -18,7 +18,7 @@ public class Solution { @Column(nullable = false) private Long questionId; - @OneToMany(mappedBy = "submission", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = "solution", cascade = CascadeType.ALL, orphanRemoval = true) private List answers; @Entity diff --git a/src/main/java/com/jojoidu/book/easy/practice/repository/SolutionRepository.java b/src/main/java/com/jojoidu/book/easy/practice/repository/SolutionRepository.java index 6bebea0..6daeb99 100644 --- a/src/main/java/com/jojoidu/book/easy/practice/repository/SolutionRepository.java +++ b/src/main/java/com/jojoidu/book/easy/practice/repository/SolutionRepository.java @@ -1,12 +1,7 @@ package com.jojoidu.book.easy.practice.repository; -import com.jojoidu.book.easy.practice.entity.Problem; import com.jojoidu.book.easy.practice.entity.Solution; import org.springframework.data.jpa.repository.JpaRepository; -import java.util.List; -import java.util.Optional; - public interface SolutionRepository extends JpaRepository { - Optional> findByProblem(Problem problem); } From 0c496c7357cc3b8c9f15822a7956e11e56f0d5e5 Mon Sep 17 00:00:00 2001 From: hawardShin Date: Sun, 24 Nov 2024 03:50:42 +0900 Subject: [PATCH 2/3] Feat: Set SWAGGER --- .../java/com/jojoidu/book/easy/global/config/SwaggerConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/jojoidu/book/easy/global/config/SwaggerConfig.java b/src/main/java/com/jojoidu/book/easy/global/config/SwaggerConfig.java index 13f4b45..a5d9c10 100644 --- a/src/main/java/com/jojoidu/book/easy/global/config/SwaggerConfig.java +++ b/src/main/java/com/jojoidu/book/easy/global/config/SwaggerConfig.java @@ -65,6 +65,7 @@ public OpenAPI openAPI() { .bearerFormat("JWT")); return new OpenAPI() + .addServersItem(new Server().url("https://ordereasy.duckdns.org")) .addServersItem(new Server().url("http://localhost:8080")) .components(new Components()) .info(info) From 023167779193a359c6efbe3cd2629a20a2f364d4 Mon Sep 17 00:00:00 2001 From: hawardShin Date: Sun, 24 Nov 2024 03:50:58 +0900 Subject: [PATCH 3/3] Feat: Set appspec.yml --- appspec.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 appspec.yml diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 0000000..3b004dd --- /dev/null +++ b/appspec.yml @@ -0,0 +1,22 @@ +version: 0.0 +os: linux +# destination에 아티팩트가 unzip된 결과가 생성될 디렉토리명을 넣어준다. +files: + - source: / + destination: /home/ubuntu/build/ + overwrite: yes +permissions: + - object: / + pattern: "**" + owner: ubuntu + group: ubuntu + +hooks: + AfterInstall: #AfterInstall에서 기존에 실행중이던 어플리케이션 종료시키고 ApplicationStart에서 새로운 어플리케이션 실행 + - location: scripts/stop.sh + timeout: 60 + runas: ubuntu + ApplicationStart: + - location: scripts/start.sh + timeout: 60 + runas: ubuntu