From 5be02b730389e1b17b088e258788b1a1563b4ad5 Mon Sep 17 00:00:00 2001 From: Jo Seonggyu Date: Mon, 18 Sep 2023 16:17:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20noticeSearchDto=EC=97=90=EB=8F=84=20priv?= =?UTF-8?q?ate=20=EC=B6=94=EA=B0=80=20(#131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: noticeSearchDto에도 private 추가 * fix: json 추가 * fix: 수정 및 추가 * fix: 수정 --- .../csereal/core/news/database/NewsRepository.kt | 2 +- .../com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt | 2 +- .../csereal/core/notice/database/NoticeRepository.kt | 3 ++- .../wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt | 5 ++++- .../csereal/core/seminar/database/SeminarRepository.kt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsRepository.kt index 01683e4e..76b356e2 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsRepository.kt @@ -69,7 +69,7 @@ class NewsRepositoryImpl( if (!isStaff) { isPrivateBooleanBuilder.or( - QNoticeEntity.noticeEntity.isPrivate.eq(false) + newsEntity.isPrivate.eq(false) ) } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt index 2b95ca7c..5deda4e5 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt @@ -11,5 +11,5 @@ data class NewsSearchDto @QueryProjection constructor( val date: LocalDateTime?, var tags: List?, var imageURL: String?, - val isPrivate: Boolean + val isPrivate: Boolean, ) diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeRepository.kt index eb94fd7e..0a0776e4 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeRepository.kt @@ -77,7 +77,8 @@ class NoticeRepositoryImpl( noticeEntity.title, noticeEntity.createdAt, noticeEntity.isPinned, - noticeEntity.attachments.isNotEmpty + noticeEntity.attachments.isNotEmpty, + noticeEntity.isPrivate ) ) .from(noticeEntity) diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt index c093e37c..fb819cba 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt @@ -1,5 +1,6 @@ package com.wafflestudio.csereal.core.notice.dto +import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import com.wafflestudio.csereal.core.notice.database.NoticeEntity import java.time.LocalDateTime @@ -10,12 +11,14 @@ data class NoticeSearchDto @QueryProjection constructor( val createdAt: LocalDateTime?, val isPinned: Boolean, val hasAttachment: Boolean, + val isPrivate: Boolean, ) { constructor(entity: NoticeEntity, hasAttachment: Boolean) : this( entity.id, entity.title, entity.createdAt, entity.isPinned, - hasAttachment + hasAttachment, + entity.isPrivate ) } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt index 537ff4c3..26d3633a 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt @@ -61,7 +61,7 @@ class SeminarRepositoryImpl( if (!isStaff) { isPrivateBooleanBuilder.or( - QNoticeEntity.noticeEntity.isPrivate.eq(false) + seminarEntity.isPrivate.eq(false) ) }