From 7ee57aa50b3ea1ce76c688dead41400b4df40310 Mon Sep 17 00:00:00 2001 From: mikekks Date: Sat, 14 Sep 2024 09:51:38 +0900 Subject: [PATCH 1/6] =?UTF-8?q?hotfix:=20=EB=A7=88=EC=A7=80=EB=A7=89=20?= =?UTF-8?q?=EB=8B=B5=EB=B3=80=EC=9D=BC=20=EA=B2=BD=EC=9A=B0,=20=EB=A7=88?= =?UTF-8?q?=EA=B0=90=EC=9D=BC=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/layer/domain/answer/service/AnswerService.java | 1 + .../java/org/layer/domain/retrospect/entity/Retrospect.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java index 693d6d93..5e0e5f2e 100644 --- a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java +++ b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java @@ -107,6 +107,7 @@ public void create(AnswerListCreateRequest request, Long spaceId, Long retrospec if (!retrospect.hasDeadLine()) { retrospect.updateRetrospectStatus(RetrospectStatus.DONE); + retrospect.updateDeadLine(time.now()); } retrospectRepository.saveAndFlush(retrospect); diff --git a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java index c4cebf1b..20c17cc9 100644 --- a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java +++ b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java @@ -104,4 +104,8 @@ public boolean hasDeadLine() { return true; } + + public void updateDeadLine(LocalDateTime deadline){ + this.deadline = deadline; + } } From 1d760e616725fffda34fb17d236a08321e39da80 Mon Sep 17 00:00:00 2001 From: Sejeong Kim <64718002+clean2001@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:20:14 +0900 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20API=20=EC=A0=9C=EA=B1=B0=20(#248)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/auth/controller/AuthController.java | 9 --------- .../src/main/resources/tokens/StoredCredential | Bin 1130 -> 0 bytes 2 files changed, 9 deletions(-) delete mode 100644 layer-api/src/main/resources/tokens/StoredCredential diff --git a/layer-api/src/main/java/org/layer/domain/auth/controller/AuthController.java b/layer-api/src/main/java/org/layer/domain/auth/controller/AuthController.java index a60e22fc..3ed33634 100644 --- a/layer-api/src/main/java/org/layer/domain/auth/controller/AuthController.java +++ b/layer-api/src/main/java/org/layer/domain/auth/controller/AuthController.java @@ -6,9 +6,7 @@ import org.layer.common.annotation.MemberId; import org.layer.domain.auth.controller.dto.*; import org.layer.domain.auth.service.AuthService; -import org.layer.domain.jwt.JwtToken; import org.layer.domain.jwt.service.JwtService; -import org.layer.domain.member.entity.MemberRole; import org.layer.domain.member.entity.SocialType; import org.layer.oauth.service.GoogleService; import org.layer.oauth.service.KakaoService; @@ -96,11 +94,4 @@ public String googleTest(@RequestParam("code") String code) { public Object kakaoLogin(@RequestParam(value = "code", required = false) String code) { return kakaoService.getToken(code); } - - // 테스트용 임시 컨트롤러입니다. (토큰 없이 접속 가능) - // "/create-token?id=멤버아이디" uri로 get 요청을 보내면 토큰이 발급됩니다. - @GetMapping("/create-token") - public JwtToken authTest(@RequestParam("id") Long memberId) { - return jwtService.issueToken(memberId, MemberRole.USER); - } } diff --git a/layer-api/src/main/resources/tokens/StoredCredential b/layer-api/src/main/resources/tokens/StoredCredential deleted file mode 100644 index 63b1c6c17b9026d421421e9725d098cde63b28b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1130 zcma)5L66%+6rN;vp>!*>Z~zGjq^dn|sGZo`>=N}*yh)vSv7Jqvgv}xW6MO88V|$YE zOq>M7v8vQVi&XvqCqRq1!U-WR9Jp}hKr4ZSs)`dA)KkaVN?R_~jx_J`-uJ%uzWL_( zAFz>9@Ja}0Q05FraucQ_3r;p({Qak&U;FsCHBi*S`G`PIhb|-3057o-Md^q{-h6WX zU67v(**Oun#4Rwe&QnA=1;r2cj{klAzZcGR9~1$YPXJhZe0)Nux+InZLV^g%aDrtw z!YE-fk)Cs3|u_Pv z>kAb5xdJQtDfkQ&<`V|~SU|NZ!?NaDJBpe)i!>ct4ZXv7Fx20Vc-Qu~r@D?QuTFc? z_O9L1=uy9}br!XyPI^map+vFTt#wB?+P#6*$e5<}m!ThHR38t!3ki=?hZ}<~VG6F= z^_^B6WKPEolPq+$tyz6GHJW&24LVev#P&hiqmtq_ss?4?{1wlIVx zw1#%ou`^vVs|KwdE%u%CqoAY1UNQ}(YCl}KjrQ13! Date: Wed, 30 Oct 2024 15:31:39 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=ED=9A=8C=EA=B3=A0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EB=B2=84=EA=B7=B8=20(#252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: test 코드 오류 해결 * fix: deadline null 인 경우 핸들링 * chore: prod로 수정 --- layer-api/src/main/resources/application-dev.yml | 4 ++-- .../java/org/layer/domain/retrospect/entity/Retrospect.java | 2 +- .../java/layer/domain/retrospect/entity/RetrospectTest.java | 3 ++- .../retrospect/repository/RetrospectRepositoryTest.java | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/layer-api/src/main/resources/application-dev.yml b/layer-api/src/main/resources/application-dev.yml index 82e2714c..06aa6b02 100644 --- a/layer-api/src/main/resources/application-dev.yml +++ b/layer-api/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: - ddl-auto: update + ddl-auto: validate properties: hibernate: format_sql: true @@ -49,7 +49,7 @@ google: sheet: id: ${GOOGLE_SHEET_ID} token_path: ${PROD_GOOGLE_TOKEN_PATH} - credential_path: ${PROD_GOOGLE_CREDENTIAL_PATH} + credential_path: ${PROD_GOOGLE_TOKEN_PATH} apple: login: diff --git a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java index 20c17cc9..2a714ada 100644 --- a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java +++ b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java @@ -78,7 +78,7 @@ public void validateRetrospectStatusDone() { public void updateRetrospect(String title, String introduction, LocalDateTime deadline, Time time) { - if (deadline.isBefore(time.now())) { + if (deadline != null && deadline.isBefore(time.now())) { throw new RetrospectException(INVALID_DEADLINE); } diff --git a/layer-domain/src/test/java/layer/domain/retrospect/entity/RetrospectTest.java b/layer-domain/src/test/java/layer/domain/retrospect/entity/RetrospectTest.java index b6207fb6..9ed01529 100644 --- a/layer-domain/src/test/java/layer/domain/retrospect/entity/RetrospectTest.java +++ b/layer-domain/src/test/java/layer/domain/retrospect/entity/RetrospectTest.java @@ -4,6 +4,7 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; +import org.layer.domain.retrospect.entity.AnalysisStatus; import org.layer.domain.retrospect.entity.Retrospect; import org.layer.domain.retrospect.entity.RetrospectStatus; @@ -12,7 +13,7 @@ public class RetrospectTest { @Test void 진행중인_회고는_진행여부로직에서_예외를_발생시키지_않는다() { // given - Retrospect retrospect = new Retrospect(1L, "회고제목입니다", "회고소개입니다", RetrospectStatus.PROCEEDING, + Retrospect retrospect = new Retrospect(1L, "회고제목입니다", "회고소개입니다", RetrospectStatus.PROCEEDING, AnalysisStatus.PROCEEDING, LocalDateTime.of(2024, 8, 4, 3, 5)); // when diff --git a/layer-domain/src/test/java/layer/domain/retrospect/repository/RetrospectRepositoryTest.java b/layer-domain/src/test/java/layer/domain/retrospect/repository/RetrospectRepositoryTest.java index c8233cc7..5ffd2420 100644 --- a/layer-domain/src/test/java/layer/domain/retrospect/repository/RetrospectRepositoryTest.java +++ b/layer-domain/src/test/java/layer/domain/retrospect/repository/RetrospectRepositoryTest.java @@ -5,6 +5,7 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.layer.domain.retrospect.entity.AnalysisStatus; import org.layer.domain.retrospect.entity.Retrospect; import org.layer.domain.retrospect.entity.RetrospectStatus; import org.layer.domain.retrospect.repository.RetrospectRepository; @@ -21,7 +22,7 @@ public class RetrospectRepositoryTest { @Test void 멀티모듈_레포지토리_테스트() { // given - Retrospect retrospect = new Retrospect(1L, "회고제목입니다", "회고소개입니다", RetrospectStatus.PROCEEDING, + Retrospect retrospect = new Retrospect(1L, "회고제목입니다", "회고소개입니다", RetrospectStatus.PROCEEDING, AnalysisStatus.PROCEEDING, LocalDateTime.of(2024, 8, 4, 3, 5)); // when From 771b80b07c7eb59adbfa3bd254c918ef7934bb10 Mon Sep 17 00:00:00 2001 From: Mingyu Song <100754581+mikekks@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:52:16 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20dev=20->=20prod=20=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#254)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-batch/src/main/resources/application.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layer-batch/src/main/resources/application.yml b/layer-batch/src/main/resources/application.yml index 8d6ca436..326c8e7c 100644 --- a/layer-batch/src/main/resources/application.yml +++ b/layer-batch/src/main/resources/application.yml @@ -5,13 +5,13 @@ spring: config: import: application-secret.properties datasource: - url: ${DEV_DB_URL} - username: ${DEV_DB_NAME} - password: ${DEV_DB_PASSWORD} + url: ${PROD_DB_URL} + username: ${PROD_DB_NAME} + password: ${PROD_DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: - ddl-auto: update + ddl-auto: validate properties: hibernate: format_sql: true From e4480fc19f3abc94fc7316e44561579e531d5040 Mon Sep 17 00:00:00 2001 From: mikekks Date: Wed, 30 Oct 2024 22:41:16 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=ED=81=AC=EB=A0=88=EB=8D=B4=EC=85=98?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/tokens/StoredCredential | Bin 0 -> 1130 bytes .../batch/scheduler/RetrospectScheduler.java | 1 - 2 files changed, 1 deletion(-) create mode 100644 layer-api/src/main/resources/tokens/StoredCredential diff --git a/layer-api/src/main/resources/tokens/StoredCredential b/layer-api/src/main/resources/tokens/StoredCredential new file mode 100644 index 0000000000000000000000000000000000000000..63b1c6c17b9026d421421e9725d098cde63b28b2 GIT binary patch literal 1130 zcma)5L66%+6rN;vp>!*>Z~zGjq^dn|sGZo`>=N}*yh)vSv7Jqvgv}xW6MO88V|$YE zOq>M7v8vQVi&XvqCqRq1!U-WR9Jp}hKr4ZSs)`dA)KkaVN?R_~jx_J`-uJ%uzWL_( zAFz>9@Ja}0Q05FraucQ_3r;p({Qak&U;FsCHBi*S`G`PIhb|-3057o-Md^q{-h6WX zU67v(**Oun#4Rwe&QnA=1;r2cj{klAzZcGR9~1$YPXJhZe0)Nux+InZLV^g%aDrtw z!YE-fk)Cs3|u_Pv z>kAb5xdJQtDfkQ&<`V|~SU|NZ!?NaDJBpe)i!>ct4ZXv7Fx20Vc-Qu~r@D?QuTFc? z_O9L1=uy9}br!XyPI^map+vFTt#wB?+P#6*$e5<}m!ThHR38t!3ki=?hZ}<~VG6F= z^_^B6WKPEolPq+$tyz6GHJW&24LVev#P&hiqmtq_ss?4?{1wlIVx zw1#%ou`^vVs|KwdE%u%CqoAY1UNQ}(YCl}KjrQ13! retrospects = retrospectRepository.findAllByDeadlineBeforeAndRetrospectStatus( From ebacc05ea919efc59ca6c21dc12aaf206da45b41 Mon Sep 17 00:00:00 2001 From: mikekks Date: Wed, 30 Oct 2024 22:49:17 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=EB=B3=80=EA=B2=BD=EA=B0=90=EC=A7=80?= =?UTF-8?q?=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/k3s-dev.yaml | 4 ++-- layer-api/src/main/java/org/layer/LayerApplication.java | 1 - .../java/org/layer/batch/scheduler/RetrospectScheduler.java | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/k3s-dev.yaml b/.github/workflows/k3s-dev.yaml index bef2a125..35a596a5 100644 --- a/.github/workflows/k3s-dev.yaml +++ b/.github/workflows/k3s-dev.yaml @@ -42,7 +42,7 @@ jobs: run: | CHANGED_MODULES="" - if [[ $(git diff --name-only HEAD^ HEAD) =~ ^layer-api/ ]]; then + if git diff --name-only HEAD^ HEAD | grep -q '^layer-api/'; then if [ -z "$CHANGED_MODULES" ]; then CHANGED_MODULES="layer-api" else @@ -50,7 +50,7 @@ jobs: fi fi - if [[ $(git diff --name-only HEAD^ HEAD) =~ ^layer-batch/ ]]; then + if git diff --name-only HEAD^ HEAD | grep -q '^layer-batch/'; then if [ -z "$CHANGED_MODULES" ]; then CHANGED_MODULES="layer-batch" else diff --git a/layer-api/src/main/java/org/layer/LayerApplication.java b/layer-api/src/main/java/org/layer/LayerApplication.java index d82fd23e..3e403f01 100644 --- a/layer-api/src/main/java/org/layer/LayerApplication.java +++ b/layer-api/src/main/java/org/layer/LayerApplication.java @@ -25,5 +25,4 @@ public static void main(String[] args) { SpringApplication.run(LayerApplication.class, args); } - } \ No newline at end of file diff --git a/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java b/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java index 49db8253..9280f083 100644 --- a/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java +++ b/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java @@ -35,6 +35,7 @@ public class RetrospectScheduler { @Scheduled(cron = "0 0 * * * *") public void updateRetrospectStatusToDone() { log.info("Batch Start : updateRetrospectStatusToDone"); + LocalDateTime now = time.now(); List retrospects = retrospectRepository.findAllByDeadlineBeforeAndRetrospectStatus(