Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: 과릿 1.4.3 #485

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dev-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 반영
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 반영
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,17 @@ 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<MemberMeta> memberMetas = memberAndLectureRepository.findMemberMetaByLectureLectureId(lectureId)
.orElseThrow(() -> new ApplicationException(ErrorCode.NOT_FOUND_EXCEPTION));
List<LessonMetaRes> lessonMetaRess = new ArrayList<>();
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(),
Expand Down
18 changes: 9 additions & 9 deletions api-module/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#---
#spring:
# profiles:
# active: stag
#
#---
#spring:
# profiles:
# active: release
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public List<Long> findAllLessonIdByLectureId(Long lectureId) {

@Override
public Optional<LessonMetaRes> 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())
Expand All @@ -92,7 +92,7 @@ public Optional<LessonMetaRes> findLessonMetaByLectureIdBeforeNow(Long lectureId

@Override
public Optional<LessonMetaRes> 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())
Expand Down