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 bf3f8471..c1af0c87 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 @@ -58,17 +58,20 @@ class NoticeRepositoryImpl( val noticeEntityList = jpaQuery.orderBy(noticeEntity.isPinned.desc()) .orderBy(noticeEntity.createdAt.desc()) - .offset(20*pageNum) //로컬 테스트를 위해 잠시 5로 둘 것, 원래는 20 + .offset(20*pageNum) .limit(20) .distinct() .fetch() val noticeSearchDtoList : List = noticeEntityList.map { + val hasAttachment : Boolean = it.attachments.isNotEmpty() + NoticeSearchDto( id = it.id, title = it.title, createdAt = it.createdAt, isPinned = it.isPinned, + hasAttachment = hasAttachment ) } 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 89898ebb..7881d082 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 @@ -8,6 +8,7 @@ data class NoticeSearchDto @QueryProjection constructor( val title: String, val createdAt: LocalDateTime?, val isPinned: Boolean, + val hasAttachment: Boolean, ) { } \ No newline at end of file