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

fix: isPublic -> isPrivate으로 정리 #86

Merged
merged 2 commits into from
Sep 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class MainRepositoryImpl(
private val seminarRepository: SeminarRepository,
) : MainRepository {
override fun readMainSlide(): List<MainSlideResponse> {
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()

Expand All @@ -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()
}
Expand All @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NewsEntity(
@Column(columnDefinition = "mediumtext")
var plainTextDescription: String,

var isPublic: Boolean,
var isPrivate: Boolean,

var isSlide: Boolean,

Expand All @@ -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,
)
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class NewsDto(
val tags: List<String>,
val createdAt: LocalDateTime?,
val modifiedAt: LocalDateTime?,
val isPublic: Boolean,
val isPrivate: Boolean,
val isSlide: Boolean,
val isImportant: Boolean,
val prevId: Long?,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NoticeEntity(
@Column(columnDefinition = "mediumtext")
var plainTextDescription: String,

var isPublic: Boolean,
var isPrivate: Boolean,
var isPinned: Boolean,
var isImportant: Boolean,

Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class NoticeDto(
val tags: List<String>,
val createdAt: LocalDateTime?,
val modifiedAt: LocalDateTime?,
val isPublic: Boolean,
val isPrivate: Boolean,
val isPinned: Boolean,
val isImportant: Boolean,
val prevId: Long?,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SeminarEntity(

var host: String?,

var isPublic: Boolean,
var isPrivate: Boolean,
var isImportant: Boolean,

@Column(columnDefinition = "text")
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -117,7 +117,7 @@ class SeminarEntity(
endDate = updateSeminarRequest.endDate
location = updateSeminarRequest.location
host = updateSeminarRequest.host
isPublic = updateSeminarRequest.isPublic
isPrivate = updateSeminarRequest.isPrivate
isImportant = updateSeminarRequest.isImportant
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NewsServiceTest(
tags = emptyList(),
createdAt = null,
modifiedAt = null,
isPublic = false,
isPrivate = false,
isSlide = false,
isImportant = false,
prevId = null,
Expand Down Expand Up @@ -69,7 +69,7 @@ class NewsServiceTest(
<h3>Goodbye, World!</h3>
""".trimIndent(),
plainTextDescription = "Hello, World! This is news description. Goodbye, World!",
isPublic = false,
isPrivate = false,
isSlide = false,
isImportant = false,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class NoticeServiceTest(
tags = emptyList(),
createdAt = null,
modifiedAt = null,
isPublic = false,
isPrivate = false,
isPinned = false,
isImportant = false,
prevId = null,
Expand Down Expand Up @@ -102,7 +102,7 @@ class NoticeServiceTest(
<h3>Goodbye, World!</h3>
""".trimIndent(),
plainTextDescription = "Hello, World! This is a test notice. Goodbye, World!",
isPublic = false,
isPrivate = false,
isPinned = false,
isImportant = false,
author = userRepository.findByUsername("username")!!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SeminarServiceTest (
""".trimIndent(),
createdAt = null,
modifiedAt = null,
isPublic = false,
isPrivate = false,
isImportant = false,
prevId = null,
prevTitle = null,
Expand Down Expand Up @@ -112,7 +112,7 @@ class SeminarServiceTest (
<h3>Goodbye, World!</h3>
""".trimIndent(),
plainTextAdditionalNote = "Hello, World! This is seminar additionalNote. Goodbye, World!",
isPublic = false,
isPrivate = false,
isImportant = false,
)
)
Expand Down