diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/admin/database/AdminRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/admin/database/AdminRepository.kt index df3effa5..f47c1092 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/admin/database/AdminRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/admin/database/AdminRepository.kt @@ -25,7 +25,7 @@ class AdminRepositoryImpl( newsEntity.createdAt ) ).from(newsEntity) - .where(newsEntity.isDeleted.eq(false), newsEntity.isPublic.eq(true), newsEntity.isSlide.eq(true)) + .where(newsEntity.isDeleted.eq(false), newsEntity.isPrivate.eq(false), newsEntity.isSlide.eq(true)) .orderBy(newsEntity.createdAt.desc()) .offset(40*pageNum) .limit(40) diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/main/database/MainRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/main/database/MainRepository.kt index b174054e..a7fd29d7 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/main/database/MainRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/main/database/MainRepository.kt @@ -33,8 +33,8 @@ class MainRepositoryImpl( private val seminarRepository: SeminarRepository, ) : MainRepository { override fun readMainSlide(): List { - val newsEntityList = queryFactory.select(newsEntity).from(newsEntity) - .where(newsEntity.isDeleted.eq(false), newsEntity.isPublic.eq(true), newsEntity.isSlide.eq(true)) + val newsEntityList = queryFactory.selectFrom(newsEntity) + .where(newsEntity.isDeleted.eq(false), newsEntity.isPrivate.eq(false), newsEntity.isSlide.eq(true)) .orderBy(newsEntity.createdAt.desc()) .limit(20).fetch() @@ -58,7 +58,7 @@ class MainRepositoryImpl( noticeEntity.createdAt ) ).from(noticeEntity) - .where(noticeEntity.isDeleted.eq(false), noticeEntity.isPublic.eq(true)) + .where(noticeEntity.isDeleted.eq(false), noticeEntity.isPrivate.eq(false)) .orderBy(noticeEntity.isPinned.desc()).orderBy(noticeEntity.createdAt.desc()) .limit(6).fetch() } @@ -75,7 +75,7 @@ class MainRepositoryImpl( .rightJoin(noticeEntity).on(noticeTagEntity.notice.eq(noticeEntity)) .rightJoin(tagInNoticeEntity).on(noticeTagEntity.tag.eq(tagInNoticeEntity)) .where(noticeTagEntity.tag.name.eq(tagEnum)) - .where(noticeEntity.isDeleted.eq(false), noticeEntity.isPublic.eq(true)) + .where(noticeEntity.isDeleted.eq(false), noticeEntity.isPrivate.eq(true)) .orderBy(noticeEntity.isPinned.desc()).orderBy(noticeEntity.createdAt.desc()) .limit(6).distinct().fetch() } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsEntity.kt b/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsEntity.kt index 3a753bab..9304f224 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsEntity.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/news/database/NewsEntity.kt @@ -22,7 +22,7 @@ class NewsEntity( @Column(columnDefinition = "mediumtext") var plainTextDescription: String, - var isPublic: Boolean, + var isPrivate: Boolean, var isSlide: Boolean, @@ -47,7 +47,7 @@ class NewsEntity( title = newsDto.title, description = newsDto.description, plainTextDescription = cleanTextFromHtml(newsDto.description), - isPublic = newsDto.isPublic, + isPrivate = newsDto.isPrivate, isSlide = newsDto.isSlide, isImportant = newsDto.isImportant, ) @@ -61,7 +61,7 @@ class NewsEntity( } this.title = updateNewsRequest.title - this.isPublic = updateNewsRequest.isPublic + this.isPrivate = updateNewsRequest.isPrivate this.isSlide = updateNewsRequest.isSlide this.isImportant = updateNewsRequest.isImportant } 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 e5e0ba11..d2ee0793 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 @@ -62,7 +62,7 @@ class NewsRepositoryImpl( val jpaQuery = queryFactory.select(newsEntity).from(newsEntity) .leftJoin(newsTagEntity).on(newsTagEntity.news.eq(newsEntity)) - .where(newsEntity.isDeleted.eq(false), newsEntity.isPublic.eq(true)) + .where(newsEntity.isDeleted.eq(false)) .where(keywordBooleanBuilder).where(tagsBooleanBuilder) val total: Long diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsDto.kt index a2c5412d..bf707a83 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/news/dto/NewsDto.kt @@ -11,7 +11,7 @@ data class NewsDto( val tags: List, val createdAt: LocalDateTime?, val modifiedAt: LocalDateTime?, - val isPublic: Boolean, + val isPrivate: Boolean, val isSlide: Boolean, val isImportant: Boolean, val prevId: Long?, @@ -36,7 +36,7 @@ data class NewsDto( tags = this.newsTags.map { it.tag.name }, createdAt = this.createdAt, modifiedAt = this.modifiedAt, - isPublic = this.isPublic, + isPrivate = this.isPrivate, isSlide = this.isSlide, isImportant = this.isImportant, prevId = prevNews?.id, diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeEntity.kt b/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeEntity.kt index d1c3eb9d..fb46b9ae 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeEntity.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeEntity.kt @@ -19,7 +19,7 @@ class NoticeEntity( @Column(columnDefinition = "mediumtext") var plainTextDescription: String, - var isPublic: Boolean, + var isPrivate: Boolean, var isPinned: Boolean, var isImportant: Boolean, @@ -44,7 +44,7 @@ class NoticeEntity( this.title = updateNoticeRequest.title this.description = updateNoticeRequest.description - this.isPublic = updateNoticeRequest.isPublic + this.isPrivate = updateNoticeRequest.isPrivate this.isPinned = updateNoticeRequest.isPinned this.isImportant = updateNoticeRequest.isImportant } 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 0b974821..ae7874d4 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 @@ -68,7 +68,7 @@ class NoticeRepositoryImpl( val jpaQuery = queryFactory.selectFrom(noticeEntity) .leftJoin(noticeTagEntity).on(noticeTagEntity.notice.eq(noticeEntity)) - .where(noticeEntity.isDeleted.eq(false), noticeEntity.isPublic.eq(true)) + .where(noticeEntity.isDeleted.eq(false)) .where(keywordBooleanBuilder, tagsBooleanBuilder) val total: Long diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeDto.kt index 7e28e3d6..a747b934 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeDto.kt @@ -13,7 +13,7 @@ data class NoticeDto( val tags: List, val createdAt: LocalDateTime?, val modifiedAt: LocalDateTime?, - val isPublic: Boolean, + val isPrivate: Boolean, val isPinned: Boolean, val isImportant: Boolean, val prevId: Long?, @@ -38,7 +38,7 @@ data class NoticeDto( tags = this.noticeTags.map { it.tag.name.name }, createdAt = this.createdAt, modifiedAt = this.modifiedAt, - isPublic = this.isPublic, + isPrivate = this.isPrivate, isPinned = this.isPinned, isImportant = this.isImportant, prevId = prevNotice?.id, diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeService.kt b/src/main/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeService.kt index 4f2ccf32..d8fca1d5 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeService.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeService.kt @@ -86,7 +86,7 @@ class NoticeServiceImpl( title = request.title, description = request.description, plainTextDescription = cleanTextFromHtml(request.description), - isPublic = request.isPublic, + isPrivate = request.isPrivate, isPinned = request.isPinned, isImportant = request.isImportant, author = user diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarEntity.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarEntity.kt index 9c680a60..d5d63b6b 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarEntity.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarEntity.kt @@ -42,7 +42,7 @@ class SeminarEntity( var host: String?, - var isPublic: Boolean, + var isPrivate: Boolean, var isImportant: Boolean, @Column(columnDefinition = "text") @@ -82,7 +82,7 @@ class SeminarEntity( endDate = seminarDto.endDate, location = seminarDto.location, host = seminarDto.host, - isPublic = seminarDto.isPublic, + isPrivate = seminarDto.isPrivate, isImportant = seminarDto.isImportant, additionalNote = seminarDto.additionalNote, plainTextAdditionalNote = plainTextAdditionalNote, @@ -117,7 +117,7 @@ class SeminarEntity( endDate = updateSeminarRequest.endDate location = updateSeminarRequest.location host = updateSeminarRequest.host - isPublic = updateSeminarRequest.isPublic + isPrivate = updateSeminarRequest.isPrivate isImportant = updateSeminarRequest.isImportant } } 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 cc0a68ee..13ef466a 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 @@ -49,7 +49,7 @@ class SeminarRepositoryImpl( } val jpaQuery = queryFactory.selectFrom(seminarEntity) - .where(seminarEntity.isDeleted.eq(false), seminarEntity.isPublic.eq(true)) + .where(seminarEntity.isDeleted.eq(false)) .where(keywordBooleanBuilder) val total: Long diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarDto.kt index 3de25d31..91c58b78 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarDto.kt @@ -22,7 +22,7 @@ data class SeminarDto( val additionalNote: String?, val createdAt: LocalDateTime?, val modifiedAt: LocalDateTime?, - val isPublic: Boolean, + val isPrivate: Boolean, val isImportant: Boolean, val prevId: Long?, val prevTitle: String?, @@ -57,7 +57,7 @@ data class SeminarDto( additionalNote = this.additionalNote, createdAt = this.createdAt, modifiedAt = this.modifiedAt, - isPublic = this.isPublic, + isPrivate = this.isPrivate, isImportant = this.isImportant, prevId = prevSeminar?.id, prevTitle = prevSeminar?.title, diff --git a/src/test/kotlin/com/wafflestudio/csereal/core/notice/news/NewsServiceTest.kt b/src/test/kotlin/com/wafflestudio/csereal/core/notice/news/NewsServiceTest.kt index 7da09dc7..0971633f 100644 --- a/src/test/kotlin/com/wafflestudio/csereal/core/notice/news/NewsServiceTest.kt +++ b/src/test/kotlin/com/wafflestudio/csereal/core/notice/news/NewsServiceTest.kt @@ -33,7 +33,7 @@ class NewsServiceTest( tags = emptyList(), createdAt = null, modifiedAt = null, - isPublic = false, + isPrivate = false, isSlide = false, isImportant = false, prevId = null, @@ -69,7 +69,7 @@ class NewsServiceTest(

Goodbye, World!

""".trimIndent(), plainTextDescription = "Hello, World! This is news description. Goodbye, World!", - isPublic = false, + isPrivate = false, isSlide = false, isImportant = false, ) diff --git a/src/test/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeServiceTest.kt b/src/test/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeServiceTest.kt index fd72d6a2..173be98a 100644 --- a/src/test/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeServiceTest.kt +++ b/src/test/kotlin/com/wafflestudio/csereal/core/notice/service/NoticeServiceTest.kt @@ -68,7 +68,7 @@ class NoticeServiceTest( tags = emptyList(), createdAt = null, modifiedAt = null, - isPublic = false, + isPrivate = false, isPinned = false, isImportant = false, prevId = null, @@ -102,7 +102,7 @@ class NoticeServiceTest(

Goodbye, World!

""".trimIndent(), plainTextDescription = "Hello, World! This is a test notice. Goodbye, World!", - isPublic = false, + isPrivate = false, isPinned = false, isImportant = false, author = userRepository.findByUsername("username")!!, diff --git a/src/test/kotlin/com/wafflestudio/csereal/core/seminar/service/SeminarServiceTest.kt b/src/test/kotlin/com/wafflestudio/csereal/core/seminar/service/SeminarServiceTest.kt index 03669627..0ff9573a 100644 --- a/src/test/kotlin/com/wafflestudio/csereal/core/seminar/service/SeminarServiceTest.kt +++ b/src/test/kotlin/com/wafflestudio/csereal/core/seminar/service/SeminarServiceTest.kt @@ -55,7 +55,7 @@ class SeminarServiceTest ( """.trimIndent(), createdAt = null, modifiedAt = null, - isPublic = false, + isPrivate = false, isImportant = false, prevId = null, prevTitle = null, @@ -112,7 +112,7 @@ class SeminarServiceTest (

Goodbye, World!

""".trimIndent(), plainTextAdditionalNote = "Hello, World! This is seminar additionalNote. Goodbye, World!", - isPublic = false, + isPrivate = false, isImportant = false, ) )