Skip to content

Commit

Permalink
Feat: 과릿 1.3.2 (#397)
Browse files Browse the repository at this point in the history
* Feat: 과릿 1.3.2 (#396)

* Hotfix: 알림 리스트 반환 시, 게시글 id 반환하도록 수정 (#395)

* Hotfix: Null 반환하지 않도록 수정 #394

* Hotfix: NotificationRes DTO 수정 #394

* Hotfix: DTO 변경에 따른 쿼리 수정 #394
  • Loading branch information
dl-00-e8 authored Jan 10, 2024
1 parent 1f8ab95 commit 8993bff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ public BoardFileRes getFileCapacity(Member member, Long lectureId) {

// Business Logic
Long fileCapacity = fileRepository.findCapacityByLectureId(lectureId);
if(fileCapacity == null) {
fileCapacity = 0L;
}

return new BoardFileRes(lectureId, fileCapacity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class NotificationRes {

private final String url;

private final Long boardId;

private final LocalDateTime createdAt;

public NotificationRes(Notification notification) {
Expand All @@ -37,6 +39,7 @@ public NotificationRes(Notification notification) {
this.lectureId = notification.getLectureId();
this.lessonId = notification.getLessonId();
this.url = notification.getUrl();
this.boardId = notification.getBoardId();
this.createdAt = notification.getCreatedAt();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class NotificationRepositoryImpl implements NotificationRepositoryCustom

@Override
public Slice<NotificationRes> findNotificationPageableBy(Long cursor, LocalDateTime cursorCreatedAt, Pageable pageable, Long memberId) {
List<NotificationRes> content = queryFactory.select(Projections.constructor(NotificationRes.class, notification.notificationId, notification.memberId, notification.title, notification.body, notification.name, notification.lectureId, notification.lessonId, notification.url, notification.createdAt ))
List<NotificationRes> content = queryFactory.select(Projections.constructor(NotificationRes.class, notification.notificationId, notification.memberId, notification.title, notification.body, notification.name, notification.lectureId, notification.lessonId, notification.url, notification.boardId, notification.createdAt ))
.from(notification)
.leftJoin(memberAndNotification).on(memberAndNotification.notificationId.eq(notification.notificationId))
.where(notification.deletedAt.isNull().and(notification.memberId.isNull().or(memberAndNotification.memberId.eq(memberId))), eqCursorIdAndCursorCreatedAt(cursor, cursorCreatedAt))
Expand Down

0 comments on commit 8993bff

Please sign in to comment.