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-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-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/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-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 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..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); } @@ -104,4 +104,8 @@ public boolean hasDeadLine() { return true; } + + public void updateDeadLine(LocalDateTime deadline){ + this.deadline = 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