diff --git a/.github/workflows/dev-CD.yml b/.github/workflows/dev-CD.yml index b0f64560..bf9dd4c7 100644 --- a/.github/workflows/dev-CD.yml +++ b/.github/workflows/dev-CD.yml @@ -61,7 +61,7 @@ jobs: - name: Make application-dev.yml run: | cd ./api-module/src/main/resources - echo "${{ secrets.APPLICATION_DEV }}" > ./application-release.yml + echo "${{ secrets.APPLICATION_DEV }}" > ./application.yml shell: bash # domain yml 반영 diff --git a/.github/workflows/release-CD.yml b/.github/workflows/release-CD.yml index d81816a1..4300f524 100644 --- a/.github/workflows/release-CD.yml +++ b/.github/workflows/release-CD.yml @@ -62,7 +62,7 @@ jobs: - name: Make application-release.yml run: | cd ./api-module/src/main/resources - echo "${{ secrets.APPLICATION_RELEASE }}" > ./application-release.yml + echo "${{ secrets.APPLICATION_RELEASE }}" > ./application.yml shell: bash # secret yml 반영 diff --git a/api-module/src/main/java/com/selfrunner/apimodule/application/lecture/LectureService.java b/api-module/src/main/java/com/selfrunner/apimodule/application/lecture/LectureService.java index a7d1adfa..39268900 100644 --- a/api-module/src/main/java/com/selfrunner/apimodule/application/lecture/LectureService.java +++ b/api-module/src/main/java/com/selfrunner/apimodule/application/lecture/LectureService.java @@ -324,6 +324,8 @@ public GetLectureRes getLectureAndLesson(Member member, Long lectureId) { MemberAndLecture memberAndLecture = memberAndLectureRepository.findMemberAndLectureByMemberAndLectureLectureId(member, lectureId) .orElseThrow(() -> new ApplicationException(ErrorCode.UNAUTHORIZED_EXCEPTION)); // Class 소속 여부 확인 + System.out.println("memberAndLecture: " + memberAndLecture.getMemberAndLectureId()); + // Business Logic List memberMetas = memberAndLectureRepository.findMemberMetaByLectureLectureId(lectureId) .orElseThrow(() -> new ApplicationException(ErrorCode.NOT_FOUND_EXCEPTION)); @@ -331,6 +333,8 @@ public GetLectureRes getLectureAndLesson(Member member, Long lectureId) { lessonMetaRess.add(lessonRepository.findLessonMetaByLectureIdBeforeNow(lectureId).orElse(null)); // TODO: Optional 사용 시, NullPointException 발생 이유 분석 lessonMetaRess.add(lessonRepository.findLessonMetaByLectureIdAfterNow(lectureId).orElse(null)); + System.out.println("memberAndLecture2: " + memberAndLecture.getMemberAndLectureId()); + // Response return new GetLectureRes(memberAndLecture.getLecture().getLectureId(), memberAndLecture.getName(), diff --git a/api-module/src/main/resources/application.yml b/api-module/src/main/resources/application.yml index 47aa859a..eb5cc3b5 100644 --- a/api-module/src/main/resources/application.yml +++ b/api-module/src/main/resources/application.yml @@ -29,12 +29,12 @@ sentry: dsn: ENC(kcWB8bBCxkeKlhoM0lJKkfXx29L8hWgX5N03JGF6IQ47OZMC7Fn8IleH+AdjVqFtniKKzqs4yTYsdm2zo9Y0scnN/E/iydqmjU/iVcMjegvYJn/AXZAlRqpU84cAXHNWd4oFcF3Bauc=) traces-sample-rate: 1.0 ---- -spring: - profiles: - active: stag - ---- -spring: - profiles: - active: release \ No newline at end of file +#--- +#spring: +# profiles: +# active: stag +# +#--- +#spring: +# profiles: +# active: release \ No newline at end of file diff --git a/common-module/src/main/java/com/selfrunner/commonmodule/vo/lecture/ScheduleVo.java b/common-module/src/main/java/com/selfrunner/commonmodule/vo/lecture/ScheduleVo.java index a2e432f6..a884246c 100644 --- a/common-module/src/main/java/com/selfrunner/commonmodule/vo/lecture/ScheduleVo.java +++ b/common-module/src/main/java/com/selfrunner/commonmodule/vo/lecture/ScheduleVo.java @@ -27,4 +27,10 @@ public ScheduleVo(Day weekday, String startTime, String endTime) { this.startTime = startTime; this.endTime = endTime; } + + public ScheduleVo(String weekday, String startTime, String endTime) { + this.weekday = Day.valueOf(weekday); + this.startTime = startTime; + this.endTime = endTime; + } } diff --git a/domain-module/src/main/java/com/selfrunner/domainmodule/domain/lesson/repository/LessonRepositoryImpl.java b/domain-module/src/main/java/com/selfrunner/domainmodule/domain/lesson/repository/LessonRepositoryImpl.java index b2eec68a..51b2a254 100644 --- a/domain-module/src/main/java/com/selfrunner/domainmodule/domain/lesson/repository/LessonRepositoryImpl.java +++ b/domain-module/src/main/java/com/selfrunner/domainmodule/domain/lesson/repository/LessonRepositoryImpl.java @@ -83,7 +83,7 @@ public List findAllLessonIdByLectureId(Long lectureId) { @Override public Optional findLessonMetaByLectureIdBeforeNow(Long lectureId) { - return Optional.ofNullable(queryFactory.select(Projections.constructor(LessonMetaRes.class, lesson.lessonId, lesson.lecture.lectureId, lesson.type, lesson.date, Projections.constructor(ScheduleVo.class, lesson.weekday, lesson.startTime, lesson.endTime), lesson.participants)) + return Optional.ofNullable(queryFactory.select(Projections.constructor(LessonMetaRes.class, lesson.lessonId, lesson.lecture.lectureId, lesson.type, lesson.date, Projections.constructor(ScheduleVo.class, lesson.weekday.stringValue(), lesson.startTime, lesson.endTime), lesson.participants)) .from(lesson) .where(lesson.lecture.lectureId.eq(lectureId), lesson.date.before(LocalDate.now().plusDays(1L))) .orderBy(lesson.date.desc(), lesson.startTime.desc(), lesson.endTime.desc()) @@ -92,7 +92,7 @@ public Optional findLessonMetaByLectureIdBeforeNow(Long lectureId @Override public Optional findLessonMetaByLectureIdAfterNow(Long lectureId) { - return Optional.ofNullable(queryFactory.select(Projections.constructor(LessonMetaRes.class, lesson.lessonId, lesson.lecture.lectureId, lesson.type, lesson.date, Projections.constructor(ScheduleVo.class, lesson.weekday, lesson.startTime, lesson.endTime), lesson.participants)) + return Optional.ofNullable(queryFactory.select(Projections.constructor(LessonMetaRes.class, lesson.lessonId, lesson.lecture.lectureId, lesson.type, lesson.date, Projections.constructor(ScheduleVo.class, lesson.weekday.stringValue(), lesson.startTime, lesson.endTime), lesson.participants)) .from(lesson) .where(lesson.lecture.lectureId.eq(lectureId), lesson.date.after(LocalDate.now())) .orderBy(lesson.date.asc(), lesson.startTime.asc(), lesson.endTime.asc())