Compare commits
No commits in common. "26b8dcee1b8d32dea6dfd8963f314699d58369de" and "78d13aee1a088dd292697b2b4f5486101b942899" have entirely different histories.
26b8dcee1b
...
78d13aee1a
|
@ -185,8 +185,19 @@ class CreatorCommunityService(
|
||||||
|
|
||||||
val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId)
|
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(
|
it.toCommunityPostListResponse(
|
||||||
imageHost = imageHost,
|
imageHost = imageHost,
|
||||||
|
content = content,
|
||||||
date = getTimeAgoString(it.date),
|
date = getTimeAgoString(it.date),
|
||||||
isLike = isLike,
|
isLike = isLike,
|
||||||
existOrdered = if (memberId == it.creatorId) {
|
existOrdered = if (memberId == it.creatorId) {
|
||||||
|
@ -240,8 +251,19 @@ class CreatorCommunityService(
|
||||||
|
|
||||||
val existOrdered = useCanRepository.isExistOrdered(postId = post.id, memberId = memberId)
|
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(
|
return post.toCommunityPostListResponse(
|
||||||
imageHost = imageHost,
|
imageHost = imageHost,
|
||||||
|
content = content,
|
||||||
date = getTimeAgoString(post.date),
|
date = getTimeAgoString(post.date),
|
||||||
isLike = isLike,
|
isLike = isLike,
|
||||||
existOrdered = if (memberId == post.creatorId) {
|
existOrdered = if (memberId == post.creatorId) {
|
||||||
|
@ -382,10 +404,10 @@ class CreatorCommunityService(
|
||||||
}
|
}
|
||||||
.map {
|
.map {
|
||||||
val isLike =
|
val isLike =
|
||||||
likeRepository.findByPostIdAndMemberId(postId = it.id, memberId = memberId)?.isActive ?: false
|
likeRepository.findByPostIdAndMemberId(postId = it.id!!, memberId = memberId)?.isActive ?: false
|
||||||
val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(it.id)
|
val likeCount = likeRepository.totalCountCommunityPostLikeByPostId(it.id!!)
|
||||||
val commentCount = if (it.isCommentAvailable) {
|
val commentCount = if (it.isCommentAvailable) {
|
||||||
commentRepository.totalCountCommentByPostId(postId = it.id)
|
commentRepository.totalCountCommentByPostId(postId = it.id!!)
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
@ -409,8 +431,19 @@ class CreatorCommunityService(
|
||||||
|
|
||||||
val existOrdered = useCanRepository.isExistOrdered(postId = it.id, memberId = memberId)
|
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(
|
it.toCommunityPostListResponse(
|
||||||
imageHost = imageHost,
|
imageHost = imageHost,
|
||||||
|
content = content,
|
||||||
date = getTimeAgoString(it.date),
|
date = getTimeAgoString(it.date),
|
||||||
isLike = isLike,
|
isLike = isLike,
|
||||||
existOrdered = if (memberId == it.creatorId) {
|
existOrdered = if (memberId == it.creatorId) {
|
||||||
|
|
|
@ -17,6 +17,7 @@ data class SelectCommunityPostResponse @QueryProjection constructor(
|
||||||
) {
|
) {
|
||||||
fun toCommunityPostListResponse(
|
fun toCommunityPostListResponse(
|
||||||
imageHost: String,
|
imageHost: String,
|
||||||
|
content: String,
|
||||||
date: String,
|
date: String,
|
||||||
isLike: Boolean,
|
isLike: Boolean,
|
||||||
existOrdered: Boolean,
|
existOrdered: Boolean,
|
||||||
|
|
Loading…
Reference in New Issue