From e1179c81e2d9f1f65034edd54e7c5255abea2a0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-USQPRVG\\gram" Date: Mon, 18 Sep 2023 14:52:36 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20noticeSearchDto=EC=97=90=EB=8F=84=20?= =?UTF-8?q?private=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wafflestudio/csereal/core/news/database/NewsRepository.kt | 2 +- .../csereal/core/notice/database/NoticeRepository.kt | 3 ++- .../wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt | 4 +++- 3 files changed, 6 insertions(+), 3 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/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..fb4ef6b0 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 @@ -10,12 +10,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 ) } From 0c472c45d68e636b78117395487ea367141f22a2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-USQPRVG\\gram" Date: Mon, 18 Sep 2023 15:15:27 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20json=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../csereal/core/news/database/NewsRepository.kt | 2 +- .../wafflestudio/csereal/core/news/dto/NewsSearchDto.kt | 7 +++++-- .../csereal/core/notice/dto/NoticeSearchDto.kt | 5 +++++ .../csereal/core/seminar/dto/SeminarSearchDto.kt | 5 +++++ 4 files changed, 16 insertions(+), 3 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 76b356e2..4c86ad26 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 @@ -106,7 +106,7 @@ class NewsRepositoryImpl( date = it.date, tags = it.newsTags.map { newsTagEntity -> newsTagEntity.tag.name.krName }, imageURL = imageURL, - isPrivate = it.isPrivate + isPrivate = it.isPrivate, ) } return NewsSearchResponse(total, newsSearchDtoList) 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..bab8104b 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 @@ -1,9 +1,10 @@ package com.wafflestudio.csereal.core.news.dto +import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import java.time.LocalDateTime -data class NewsSearchDto @QueryProjection constructor( +data class NewsSearchDto( val id: Long, val title: String, var description: String, @@ -11,5 +12,7 @@ data class NewsSearchDto @QueryProjection constructor( val date: LocalDateTime?, var tags: List?, var imageURL: String?, - val isPrivate: Boolean + @get:JsonProperty("isPrivate") + @param:JsonProperty("isPrivate") + val isPrivate: Boolean, ) 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 fb4ef6b0..a48989ff 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 @@ -8,8 +9,12 @@ data class NoticeSearchDto @QueryProjection constructor( val id: Long, val title: String, val createdAt: LocalDateTime?, + @get:JsonProperty("isPinned") + @param:JsonProperty("isPinned") val isPinned: Boolean, val hasAttachment: Boolean, + @get:JsonProperty("isPrivate") + @param:JsonProperty("isPrivate") val isPrivate: Boolean, ) { constructor(entity: NoticeEntity, hasAttachment: Boolean) : this( diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt index 79222ce1..42bb1d23 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt @@ -1,5 +1,6 @@ package com.wafflestudio.csereal.core.seminar.dto +import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import java.time.LocalDateTime @@ -12,7 +13,11 @@ data class SeminarSearchDto @QueryProjection constructor( val startDate: LocalDateTime?, val location: String, val imageURL: String?, + @get:JsonProperty("isYearLast") + @param:JsonProperty("isYearLast") val isYearLast: Boolean, + @get:JsonProperty("isPrivate") + @param:JsonProperty("isPrivate") val isPrivate: Boolean ) { } From b245a800dc1728babac032f7b58570525216420d Mon Sep 17 00:00:00 2001 From: "DESKTOP-USQPRVG\\gram" Date: Mon, 18 Sep 2023 15:47:15 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 + .../com/wafflestudio/csereal/common/config/JacksonConfig.kt | 1 + .../com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt | 2 -- .../wafflestudio/csereal/core/notice/dto/NoticeSearchDto.kt | 4 ---- .../csereal/core/seminar/database/SeminarRepository.kt | 2 +- .../wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt | 4 ---- 6 files changed, 3 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3948e7d1..11b82907 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,6 +27,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-validation") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.13.3") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0") runtimeOnly("com.mysql:mysql-connector-j") diff --git a/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt b/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt index a1558b82..6defdc7e 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.JsonSerializer import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.module.SimpleModule +import com.fasterxml.jackson.module.kotlin.registerKotlinModule import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.time.LocalDateTime 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 bab8104b..9b7d9a07 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 @@ -12,7 +12,5 @@ data class NewsSearchDto( val date: LocalDateTime?, var tags: List?, var imageURL: String?, - @get:JsonProperty("isPrivate") - @param:JsonProperty("isPrivate") val isPrivate: Boolean, ) 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 a48989ff..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 @@ -9,12 +9,8 @@ data class NoticeSearchDto @QueryProjection constructor( val id: Long, val title: String, val createdAt: LocalDateTime?, - @get:JsonProperty("isPinned") - @param:JsonProperty("isPinned") val isPinned: Boolean, val hasAttachment: Boolean, - @get:JsonProperty("isPrivate") - @param:JsonProperty("isPrivate") val isPrivate: Boolean, ) { constructor(entity: NoticeEntity, hasAttachment: Boolean) : this( 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) ) } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt index 42bb1d23..5e140215 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt @@ -13,11 +13,7 @@ data class SeminarSearchDto @QueryProjection constructor( val startDate: LocalDateTime?, val location: String, val imageURL: String?, - @get:JsonProperty("isYearLast") - @param:JsonProperty("isYearLast") val isYearLast: Boolean, - @get:JsonProperty("isPrivate") - @param:JsonProperty("isPrivate") val isPrivate: Boolean ) { } From c1b587221cc030a0a4e68952c0e40ab078693f3a Mon Sep 17 00:00:00 2001 From: "DESKTOP-USQPRVG\\gram" Date: Mon, 18 Sep 2023 15:50:08 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 - .../com/wafflestudio/csereal/common/config/JacksonConfig.kt | 1 - .../wafflestudio/csereal/core/news/database/NewsRepository.kt | 2 +- .../com/wafflestudio/csereal/core/news/dto/NewsSearchDto.kt | 3 +-- .../wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 11b82907..3948e7d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,6 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-validation") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - implementation("com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.13.3") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0") runtimeOnly("com.mysql:mysql-connector-j") diff --git a/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt b/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt index 6defdc7e..a1558b82 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/common/config/JacksonConfig.kt @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.JsonSerializer import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.module.SimpleModule -import com.fasterxml.jackson.module.kotlin.registerKotlinModule import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.time.LocalDateTime 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 4c86ad26..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 @@ -106,7 +106,7 @@ class NewsRepositoryImpl( date = it.date, tags = it.newsTags.map { newsTagEntity -> newsTagEntity.tag.name.krName }, imageURL = imageURL, - isPrivate = it.isPrivate, + isPrivate = it.isPrivate ) } return NewsSearchResponse(total, newsSearchDtoList) 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 9b7d9a07..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 @@ -1,10 +1,9 @@ package com.wafflestudio.csereal.core.news.dto -import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import java.time.LocalDateTime -data class NewsSearchDto( +data class NewsSearchDto @QueryProjection constructor( val id: Long, val title: String, var description: String, diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt index 5e140215..79222ce1 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/dto/SeminarSearchDto.kt @@ -1,6 +1,5 @@ package com.wafflestudio.csereal.core.seminar.dto -import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import java.time.LocalDateTime