Compare commits
2 Commits
78d13aee1a
...
26b8dcee1b
Author | SHA1 | Date |
---|---|---|
|
26b8dcee1b | |
|
0c0c4019aa |
|
@ -185,19 +185,8 @@ class CreatorCommunityService(
|
|||
|
||||
val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId)
|
||||
|
||||
val content = if (it.price > 0 && memberId != it.creatorId) {
|
||||
if (existOrdered) {
|
||||
it.content
|
||||
} else {
|
||||
it.content.substring(0, 5).plus("...")
|
||||
}
|
||||
} else {
|
||||
it.content
|
||||
}
|
||||
|
||||
it.toCommunityPostListResponse(
|
||||
imageHost = imageHost,
|
||||
content = content,
|
||||
date = getTimeAgoString(it.date),
|
||||
isLike = isLike,
|
||||
existOrdered = if (memberId == it.creatorId) {
|
||||
|
@ -251,19 +240,8 @@ class CreatorCommunityService(
|
|||
|
||||
val existOrdered = useCanRepository.isExistOrdered(postId = post.id, memberId = memberId)
|
||||
|
||||
val content = if (post.price > 0 && memberId != post.creatorId) {
|
||||
if (existOrdered) {
|
||||
post.content
|
||||
} else {
|
||||
post.content.substring(0, 5).plus("...")
|
||||
}
|
||||
} else {
|
||||
post.content
|
||||
}
|
||||
|
||||
return post.toCommunityPostListResponse(
|
||||
imageHost = imageHost,
|
||||
content = content,
|
||||
date = getTimeAgoString(post.date),
|
||||
isLike = isLike,
|
||||
existOrdered = if (memberId == post.creatorId) {
|
||||
|
@ -404,10 +382,10 @@ class CreatorCommunityService(
|
|||
}
|
||||
.map {
|
||||
val isLike =
|
||||
likeRepository.findByPostIdAndMemberId(postId = it.id!!, memberId = memberId)?.isActive ?: false
|
||||
val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(it.id!!)
|
||||
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)
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
@ -431,19 +409,8 @@ class CreatorCommunityService(
|
|||
|
||||
val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId)
|
||||
|
||||
val content = if (it.price > 0 && memberId != it.creatorId) {
|
||||
if (existOrdered) {
|
||||
it.content
|
||||
} else {
|
||||
it.content.substring(0, 5).plus("...")
|
||||
}
|
||||
} else {
|
||||
it.content
|
||||
}
|
||||
|
||||
it.toCommunityPostListResponse(
|
||||
imageHost = imageHost,
|
||||
content = content,
|
||||
date = getTimeAgoString(it.date),
|
||||
isLike = isLike,
|
||||
existOrdered = if (memberId == it.creatorId) {
|
||||
|
|
|
@ -17,7 +17,6 @@ data class SelectCommunityPostResponse @QueryProjection constructor(
|
|||
) {
|
||||
fun toCommunityPostListResponse(
|
||||
imageHost: String,
|
||||
content: String,
|
||||
date: String,
|
||||
isLike: Boolean,
|
||||
existOrdered: Boolean,
|
||||
|
|
Loading…
Reference in New Issue