From 8e01ced1f5286283489d0bcb2d23f8c2ed5fda90 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 12 Jun 2025 16:10:32 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=EC=BB=A4=EB=AE=A4=EB=8B=88?= =?UTF-8?q?=ED=8B=B0=20=EB=8C=93=EA=B8=80=20-=20=EC=9C=A0=EB=A3=8C=20?= =?UTF-8?q?=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0=20=EA=B8=80=EC=9D=84=20?= =?UTF-8?q?=EA=B5=AC=EB=A7=A4=ED=95=9C=20=EA=B2=BD=EC=9A=B0=20=EB=B9=84?= =?UTF-8?q?=EB=B0=80=20=EB=8C=93=EA=B8=80=20=EC=93=B0=EA=B8=B0=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/can/use/UseCanRepository.kt | 5 ++-- .../CreatorCommunityController.kt | 1 + .../CreatorCommunityService.kt | 23 ++++++++++++++----- .../CreateCommunityPostCommentRequest.kt | 7 +++++- .../comment/CreatorCommunityComment.kt | 1 + 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCanRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCanRepository.kt index eeac478..07bdce1 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCanRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCanRepository.kt @@ -9,17 +9,18 @@ import org.springframework.stereotype.Repository interface UseCanRepository : JpaRepository, UseCanQueryRepository interface UseCanQueryRepository { - fun isExistOrdered(postId: Long, memberId: Long): Boolean + fun isExistCommunityPostOrdered(postId: Long, memberId: Long): Boolean } class UseCanQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : UseCanQueryRepository { - override fun isExistOrdered(postId: Long, memberId: Long): Boolean { + override fun isExistCommunityPostOrdered(postId: Long, memberId: Long): Boolean { val useCanId = queryFactory.select(useCan.id) .from(useCan) .where( useCan.member.id.eq(memberId) .and(useCan.isRefund.isFalse) .and(useCan.communityPost.id.eq(postId)) + .and(useCan.canUsage.eq(CanUsage.PAID_COMMUNITY_POST)) ) .fetchFirst() diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt index 85c61b8..62ce8ca 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt @@ -129,6 +129,7 @@ class CreatorCommunityController(private val service: CreatorCommunityService) { comment = request.comment, postId = request.postId, parentId = request.parentId, + isSecret = request.isSecret, member = member ) ) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt index 7e483f9..06a7c96 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt @@ -212,7 +212,7 @@ class CreatorCommunityService( null } - val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId) + val existOrdered = useCanRepository.isExistCommunityPostOrdered(postId = it.id, memberId = memberId) val audioUrl = if ( ( @@ -285,7 +285,7 @@ class CreatorCommunityService( null } - val existOrdered = useCanRepository.isExistOrdered(postId = post.id, memberId = memberId) + val existOrdered = useCanRepository.isExistCommunityPostOrdered(postId = post.id, memberId = memberId) val audioUrl = if ((post.price <= 0 || existOrdered) && post.audioPath != null) { audioContentCloudFront.generateSignedURL( @@ -347,11 +347,22 @@ class CreatorCommunityService( } @Transactional - fun createCommunityPostComment(comment: String, postId: Long, parentId: Long?, member: Member) { + fun createCommunityPostComment( + member: Member, + comment: String, + postId: Long, + parentId: Long? = null, + isSecret: Boolean = false + ) { val post = repository.findByIdOrNull(id = postId) ?: throw SodaException("잘못된 게시물 입니다.\n다시 시도해 주세요.") + val isExistOrdered = useCanRepository.isExistCommunityPostOrdered(postId = postId, memberId = member.id!!) - val postComment = CreatorCommunityComment(comment = comment) + if (isSecret && !isExistOrdered) { + throw SodaException("게시글을 구매 후 비밀댓글을 등록할 수 있습니다.") + } + + val postComment = CreatorCommunityComment(comment = comment, isSecret = isSecret) postComment.creatorCommunity = post postComment.member = member @@ -465,7 +476,7 @@ class CreatorCommunityService( null } - val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId) + val existOrdered = useCanRepository.isExistCommunityPostOrdered(postId = it.id, memberId = memberId) it.toCommunityPostListResponse( imageHost = imageHost, @@ -499,7 +510,7 @@ class CreatorCommunityService( val isBlocked = blockMemberRepository.isBlocked(blockedMemberId = memberId, memberId = post.member!!.id!!) if (isBlocked) throw SodaException("${post.member!!.nickname}님의 요청으로 접근이 제한됩니다.") - val existOrdered = useCanRepository.isExistOrdered(postId = postId, memberId = memberId) + val existOrdered = useCanRepository.isExistCommunityPostOrdered(postId = postId, memberId = memberId) if (!existOrdered) { canPaymentService.spendCan( diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreateCommunityPostCommentRequest.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreateCommunityPostCommentRequest.kt index 5e833d6..bd01576 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreateCommunityPostCommentRequest.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreateCommunityPostCommentRequest.kt @@ -1,3 +1,8 @@ package kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.comment -data class CreateCommunityPostCommentRequest(val comment: String, val postId: Long, val parentId: Long?) +data class CreateCommunityPostCommentRequest( + val comment: String, + val postId: Long, + val parentId: Long?, + val isSecret: Boolean = false +) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityComment.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityComment.kt index 6e65c0a..84af1c1 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityComment.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityComment.kt @@ -14,6 +14,7 @@ import javax.persistence.OneToMany data class CreatorCommunityComment( @Column(columnDefinition = "TEXT", nullable = false) var comment: String, + val isSecret: Boolean = false, var isActive: Boolean = true ) : BaseEntity() { @ManyToOne(fetch = FetchType.LAZY) -- 2.40.1 From 6d2f48f86df1246830d6ad482d4ad0fc1a6fd743 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 12 Jun 2025 19:08:47 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0?= =?UTF-8?q?=20=EB=8C=93=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20-=20=ED=81=AC?= =?UTF-8?q?=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0=EA=B0=80=20=EC=95=84?= =?UTF-8?q?=EB=8B=8C=20=EA=B2=BD=EC=9A=B0=20=EB=82=B4=EA=B0=80=20=EC=93=B4?= =?UTF-8?q?=20=EB=B9=84=EB=B0=80=EB=8C=93=EA=B8=80=20+=20=EC=9D=BC?= =?UTF-8?q?=EB=B0=98=EB=8C=93=EA=B8=80=EB=A7=8C=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreatorCommunityController.kt | 1 + .../CreatorCommunityRepository.kt | 15 ++ .../CreatorCommunityService.kt | 57 +++++-- .../CreatorCommunityCommentRepository.kt | 160 +++++++++++------- .../GetCommunityPostCommentListResponse.kt | 6 +- 5 files changed, 158 insertions(+), 81 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt index 62ce8ca..c84e587 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityController.kt @@ -159,6 +159,7 @@ class CreatorCommunityController(private val service: CreatorCommunityService) { ApiResponse.ok( service.getCommunityPostCommentList( postId = postId, + memberId = member.id!!, timezone = timezone, offset = pageable.offset, limit = pageable.pageSize.toLong() diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityRepository.kt index 1b31eec..f10b368 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityRepository.kt @@ -28,6 +28,8 @@ interface CreatorCommunityQueryRepository { fun getLatestPostListFromCreatorsYouFollow(memberId: Long, isAdult: Boolean): List fun getCommunityPost(postId: Long, isAdult: Boolean): SelectCommunityPostResponse? + + fun isCommunityCreator(postId: Long, memberId: Long): Boolean } class CreatorCommunityQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : CreatorCommunityQueryRepository { @@ -195,4 +197,17 @@ class CreatorCommunityQueryRepositoryImpl(private val queryFactory: JPAQueryFact .where(where) .fetchFirst() } + + override fun isCommunityCreator(postId: Long, memberId: Long): Boolean { + return queryFactory + .select(member.id) + .from(creatorCommunity) + .innerJoin(creatorCommunity.member, member) + .where( + creatorCommunity.id.eq(postId) + .and(creatorCommunity.isActive.isTrue) + .and(member.id.eq(memberId)) + ) + .fetchFirst() != null + } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt index 06a7c96..b8e5415 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt @@ -190,15 +190,20 @@ class CreatorCommunityService( ?: false val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(it.id) val commentCount = if (it.isCommentAvailable) { - commentRepository.totalCountCommentByPostId(postId = it.id) + commentRepository.totalCountCommentByPostId( + postId = it.id, + memberId = memberId, + isContentCreator = it.creatorId == memberId + ) } else { 0 } val commentList = if (it.isCommentAvailable) { commentRepository.findByPostId( - cloudFrontHost = imageHost, - timezone = timezone, id = it.id, + memberId = memberId, + isContentCreator = it.creatorId == memberId, + timezone = timezone, offset = 0, limit = 1 ) @@ -263,15 +268,20 @@ class CreatorCommunityService( val isLike = likeRepository.findByPostIdAndMemberId(postId = post.id, memberId = memberId)?.isActive ?: false val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(post.id) val commentCount = if (post.isCommentAvailable) { - commentRepository.totalCountCommentByPostId(postId = post.id) + commentRepository.totalCountCommentByPostId( + postId = post.id, + memberId = memberId, + isContentCreator = post.creatorId == memberId + ) } else { 0 } val commentList = if (post.isCommentAvailable) { commentRepository.findByPostId( - cloudFrontHost = imageHost, - timezone = timezone, id = post.id, + memberId = memberId, + isContentCreator = post.creatorId == memberId, + timezone = timezone, offset = 0, limit = 1 ) @@ -401,19 +411,25 @@ class CreatorCommunityService( fun getCommunityPostCommentList( postId: Long, + memberId: Long, timezone: String, offset: Long, limit: Long ): GetCommunityPostCommentListResponse { val commentList = commentRepository.findByPostId( - cloudFrontHost = imageHost, - timezone = timezone, id = postId, + memberId = memberId, + isContentCreator = repository.isCommunityCreator(postId, memberId), + timezone = timezone, offset = offset, limit = limit ) - val totalCount = commentRepository.totalCountCommentByPostId(postId = postId) + val totalCount = commentRepository.totalCountCommentByPostId( + postId = postId, + memberId = memberId, + isContentCreator = repository.isCommunityCreator(postId, memberId) + ) return GetCommunityPostCommentListResponse(totalCount = totalCount, items = commentList) } @@ -424,7 +440,6 @@ class CreatorCommunityService( limit: Long ): GetCommunityPostCommentListResponse { val commentList = commentRepository.getCommunityCommentReplyList( - cloudFrontHost = imageHost, commentId = commentId, timezone = timezone, offset = offset, @@ -454,15 +469,20 @@ class CreatorCommunityService( likeRepository.findByPostIdAndMemberId(postId = it.id, memberId = memberId)?.isActive ?: false val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(it.id) val commentCount = if (it.isCommentAvailable) { - commentRepository.totalCountCommentByPostId(postId = it.id) + commentRepository.totalCountCommentByPostId( + postId = it.id, + memberId = memberId, + isContentCreator = it.creatorId == memberId + ) } else { 0 } val commentList = if (it.isCommentAvailable) { commentRepository.findByPostId( - cloudFrontHost = imageHost, - timezone = timezone, id = it.id, + memberId = memberId, + isContentCreator = it.creatorId == memberId, + timezone = timezone, offset = 0, limit = 1 ) @@ -525,15 +545,20 @@ class CreatorCommunityService( val isLike = likeRepository.findByPostIdAndMemberId(postId = post.id!!, memberId = memberId)?.isActive ?: false val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(post.id!!) val commentCount = if (post.isCommentAvailable) { - commentRepository.totalCountCommentByPostId(postId = post.id!!) + commentRepository.totalCountCommentByPostId( + postId = post.id!!, + memberId = memberId, + isContentCreator = false + ) } else { 0 } val commentList = if (post.isCommentAvailable) { commentRepository.findByPostId( - cloudFrontHost = imageHost, - timezone = timezone, id = post.id!!, + memberId = memberId, + isContentCreator = false, + timezone = timezone, offset = 0, limit = 1 ) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt index 2ee60bd..3784eb6 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt @@ -1,29 +1,34 @@ package kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.comment +import com.querydsl.core.types.dsl.Expressions import com.querydsl.jpa.impl.JPAQueryFactory import kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.comment.QCreatorCommunityComment.creatorCommunityComment +import org.springframework.beans.factory.annotation.Value import org.springframework.data.jpa.repository.JpaRepository -import java.time.ZoneId -import java.time.format.DateTimeFormatter +import java.time.LocalDateTime interface CreatorCommunityCommentRepository : JpaRepository, CreatorCommunityCommentQueryRepository interface CreatorCommunityCommentQueryRepository { fun findByPostId( - cloudFrontHost: String, - timezone: String, id: Long, + memberId: Long, + isContentCreator: Boolean, + timezone: String, offset: Long, limit: Long ): List fun commentReplyCountByCommentId(commentId: Long): Int - fun totalCountCommentByPostId(postId: Long): Int + fun totalCountCommentByPostId( + postId: Long, + memberId: Long, + isContentCreator: Boolean + ): Int fun getCommunityCommentReplyList( - cloudFrontHost: String, commentId: Long, timezone: String, offset: Long, @@ -32,47 +37,64 @@ interface CreatorCommunityCommentQueryRepository { } class CreatorCommunityCommentQueryRepositoryImpl( - private val queryFactory: JPAQueryFactory + private val queryFactory: JPAQueryFactory, + + @Value("\${cloud.aws.cloud-front.host}") + private val imageHost: String ) : CreatorCommunityCommentQueryRepository { override fun findByPostId( - cloudFrontHost: String, - timezone: String, id: Long, + memberId: Long, + isContentCreator: Boolean, + timezone: String, offset: Long, limit: Long ): List { - return queryFactory - .selectFrom(creatorCommunityComment) - .where( - creatorCommunityComment.isActive.isTrue - .and(creatorCommunityComment.creatorCommunity.id.eq(id)) - .and(creatorCommunityComment.parent.isNull) + val formattedDate = Expressions.stringTemplate( + "DATE_FORMAT({0}, {1})", + Expressions.dateTimeTemplate( + LocalDateTime::class.java, + "CONVERT_TZ({0},{1},{2})", + creatorCommunityComment.createdAt, + "UTC", + timezone + ), + "%Y.%m.%d %W %h:%i %p" + ) + + var where = creatorCommunityComment.isActive.isTrue + .and(creatorCommunityComment.creatorCommunity.id.eq(id)) + .and(creatorCommunityComment.parent.isNull) + + if (!isContentCreator) { + where = where.and( + creatorCommunityComment.isSecret.isFalse + .or(creatorCommunityComment.member.id.eq(memberId)) ) + } + + return queryFactory + .select( + QGetCommunityPostCommentListItem( + creatorCommunityComment.id, + creatorCommunityComment.member.id, + creatorCommunityComment.member.nickname, + creatorCommunityComment.member.profileImage.prepend(imageHost), + creatorCommunityComment.comment, + formattedDate, + Expressions.constant(0) + ) + ) + .from(creatorCommunityComment) + .where(where) .offset(offset) .limit(limit) .orderBy(creatorCommunityComment.createdAt.desc()) .fetch() - .asSequence() .map { - val date = it.createdAt!! - .atZone(ZoneId.of("UTC")) - .withZoneSameInstant(ZoneId.of(timezone)) - - GetCommunityPostCommentListItem( - id = it.id!!, - writerId = it.member!!.id!!, - nickname = it.member!!.nickname, - profileUrl = if (it.member!!.profileImage != null) { - "$cloudFrontHost/${it.member!!.profileImage}" - } else { - "$cloudFrontHost/profile/default-profile.png" - }, - comment = it.comment, - date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")), - replyCount = commentReplyCountByCommentId(it.id!!) - ) + it.replyCount = commentReplyCountByCommentId(it.id) + it } - .toList() } override fun commentReplyCountByCommentId(commentId: Long): Int { @@ -87,27 +109,60 @@ class CreatorCommunityCommentQueryRepositoryImpl( .size } - override fun totalCountCommentByPostId(postId: Long): Int { + override fun totalCountCommentByPostId( + postId: Long, + memberId: Long, + isContentCreator: Boolean + ): Int { + var where = creatorCommunityComment.creatorCommunity.id.eq(postId) + .and(creatorCommunityComment.isActive.isTrue) + .and(creatorCommunityComment.parent.isNull) + + if (!isContentCreator) { + where = where.and( + creatorCommunityComment.isSecret.isFalse + .or(creatorCommunityComment.member.id.eq(memberId)) + ) + } + return queryFactory.select(creatorCommunityComment.id) .from(creatorCommunityComment) - .where( - creatorCommunityComment.creatorCommunity.id.eq(postId) - .and(creatorCommunityComment.isActive.isTrue) - .and(creatorCommunityComment.parent.isNull) - ) + .where(where) .fetch() .size } override fun getCommunityCommentReplyList( - cloudFrontHost: String, commentId: Long, timezone: String, offset: Long, limit: Long ): List { + val formattedDate = Expressions.stringTemplate( + "DATE_FORMAT({0}, {1})", + Expressions.dateTimeTemplate( + LocalDateTime::class.java, + "CONVERT_TZ({0},{1},{2})", + creatorCommunityComment.createdAt, + "UTC", + timezone + ), + "%Y.%m.%d %W %h:%i %p" + ) + return queryFactory - .selectFrom(creatorCommunityComment) + .select( + QGetCommunityPostCommentListItem( + creatorCommunityComment.id, + creatorCommunityComment.member.id, + creatorCommunityComment.member.nickname, + creatorCommunityComment.member.profileImage.prepend(imageHost), + creatorCommunityComment.comment, + formattedDate, + Expressions.constant(0) + ) + ) + .from(creatorCommunityComment) .where( creatorCommunityComment.isActive.isTrue .and(creatorCommunityComment.parent.isNotNull) @@ -117,26 +172,5 @@ class CreatorCommunityCommentQueryRepositoryImpl( .limit(limit) .orderBy(creatorCommunityComment.createdAt.desc()) .fetch() - .asSequence() - .map { - val date = it.createdAt!! - .atZone(ZoneId.of("UTC")) - .withZoneSameInstant(ZoneId.of(timezone)) - - GetCommunityPostCommentListItem( - id = it.id!!, - writerId = it.member!!.id!!, - nickname = it.member!!.nickname, - profileUrl = if (it.member!!.profileImage != null) { - "$cloudFrontHost/${it.member!!.profileImage}" - } else { - "$cloudFrontHost/profile/default-profile.png" - }, - comment = it.comment, - date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")), - replyCount = commentReplyCountByCommentId(it.id!!) - ) - } - .toList() } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt index 58c15a4..824372f 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt @@ -1,16 +1,18 @@ package kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.comment +import com.querydsl.core.annotations.QueryProjection + data class GetCommunityPostCommentListResponse( val totalCount: Int, val items: List ) -data class GetCommunityPostCommentListItem( +data class GetCommunityPostCommentListItem @QueryProjection constructor( val id: Long, val writerId: Long, val nickname: String, val profileUrl: String, val comment: String, val date: String, - val replyCount: Int + var replyCount: Int ) -- 2.40.1 From 4ffa9363a88f6a7d4ac30fac43a70340311d2710 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 13 Jun 2025 16:06:44 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0?= =?UTF-8?q?=20=EB=8C=93=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20-=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20imageHost?= =?UTF-8?q?=EC=97=90=20/=EA=B0=80=20=ED=8F=AC=ED=95=A8=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/CreatorCommunityCommentRepository.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt index 3784eb6..1c8b7a9 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt @@ -79,7 +79,7 @@ class CreatorCommunityCommentQueryRepositoryImpl( creatorCommunityComment.id, creatorCommunityComment.member.id, creatorCommunityComment.member.nickname, - creatorCommunityComment.member.profileImage.prepend(imageHost), + creatorCommunityComment.member.profileImage.prepend("/").prepend(imageHost), creatorCommunityComment.comment, formattedDate, Expressions.constant(0) -- 2.40.1 From f13c221fd638e5fc3deb0a8cbe3835ad43f4f017 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 13 Jun 2025 16:51:10 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0?= =?UTF-8?q?=20=EB=8C=93=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20-=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=EA=B0=92=EC=97=90=20isSecret(=EB=B9=84=EB=B0=80=20?= =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=97=AC=EB=B6=80)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/CreatorCommunityCommentRepository.kt | 4 +++- .../comment/GetCommunityPostCommentListResponse.kt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt index 1c8b7a9..d6390ff 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/CreatorCommunityCommentRepository.kt @@ -81,6 +81,7 @@ class CreatorCommunityCommentQueryRepositoryImpl( creatorCommunityComment.member.nickname, creatorCommunityComment.member.profileImage.prepend("/").prepend(imageHost), creatorCommunityComment.comment, + creatorCommunityComment.isSecret, formattedDate, Expressions.constant(0) ) @@ -156,8 +157,9 @@ class CreatorCommunityCommentQueryRepositoryImpl( creatorCommunityComment.id, creatorCommunityComment.member.id, creatorCommunityComment.member.nickname, - creatorCommunityComment.member.profileImage.prepend(imageHost), + creatorCommunityComment.member.profileImage.prepend("/").prepend(imageHost), creatorCommunityComment.comment, + creatorCommunityComment.isSecret, formattedDate, Expressions.constant(0) ) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt index 824372f..2d24d08 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/comment/GetCommunityPostCommentListResponse.kt @@ -13,6 +13,7 @@ data class GetCommunityPostCommentListItem @QueryProjection constructor( val nickname: String, val profileUrl: String, val comment: String, + val isSecret: Boolean, val date: String, var replyCount: Int ) -- 2.40.1