Merge pull request '크리에이터 커뮤니티' (#198) from test into main
Reviewed-on: #198
This commit is contained in:
commit
4dce8c8f03
|
@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.explorer.profile.creatorCommunity
|
||||||
|
|
||||||
import com.querydsl.core.types.dsl.Expressions
|
import com.querydsl.core.types.dsl.Expressions
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory
|
import com.querydsl.jpa.impl.JPAQueryFactory
|
||||||
|
import kr.co.vividnext.sodalive.can.use.QUseCan.useCan
|
||||||
import kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.QCreatorCommunity.creatorCommunity
|
import kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.QCreatorCommunity.creatorCommunity
|
||||||
import kr.co.vividnext.sodalive.member.QMember.member
|
import kr.co.vividnext.sodalive.member.QMember.member
|
||||||
import kr.co.vividnext.sodalive.member.following.QCreatorFollowing.creatorFollowing
|
import kr.co.vividnext.sodalive.member.following.QCreatorFollowing.creatorFollowing
|
||||||
|
@ -17,6 +18,7 @@ interface CreatorCommunityQueryRepository {
|
||||||
|
|
||||||
fun getCommunityPostList(
|
fun getCommunityPostList(
|
||||||
creatorId: Long,
|
creatorId: Long,
|
||||||
|
memberId: Long,
|
||||||
offset: Long,
|
offset: Long,
|
||||||
limit: Long,
|
limit: Long,
|
||||||
isAdult: Boolean
|
isAdult: Boolean
|
||||||
|
@ -41,17 +43,19 @@ class CreatorCommunityQueryRepositoryImpl(private val queryFactory: JPAQueryFact
|
||||||
|
|
||||||
override fun getCommunityPostList(
|
override fun getCommunityPostList(
|
||||||
creatorId: Long,
|
creatorId: Long,
|
||||||
|
memberId: Long,
|
||||||
offset: Long,
|
offset: Long,
|
||||||
limit: Long,
|
limit: Long,
|
||||||
isAdult: Boolean
|
isAdult: Boolean
|
||||||
): List<SelectCommunityPostResponse> {
|
): List<SelectCommunityPostResponse> {
|
||||||
var where = creatorCommunity.member.id.eq(creatorId)
|
var where = creatorCommunity.isActive.isTrue
|
||||||
.and(creatorCommunity.isActive.isTrue)
|
|
||||||
|
|
||||||
if (!isAdult) {
|
if (!isAdult) {
|
||||||
where = where.and(creatorCommunity.isAdult.isFalse)
|
where = where.and(creatorCommunity.isAdult.isFalse)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
where = where.or(useCan.communityPost.isNotNull)
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QSelectCommunityPostResponse(
|
QSelectCommunityPostResponse(
|
||||||
|
@ -67,7 +71,17 @@ class CreatorCommunityQueryRepositoryImpl(private val queryFactory: JPAQueryFact
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.from(creatorCommunity)
|
.from(creatorCommunity)
|
||||||
.innerJoin(creatorCommunity.member, member)
|
.innerJoin(member)
|
||||||
|
.on(
|
||||||
|
creatorCommunity.member.id.eq(member.id)
|
||||||
|
.and(member.id.eq(creatorId))
|
||||||
|
)
|
||||||
|
.leftJoin(useCan)
|
||||||
|
.on(
|
||||||
|
creatorCommunity.id.eq(useCan.communityPost.id)
|
||||||
|
.and(useCan.member.id.eq(memberId))
|
||||||
|
.and(useCan.isRefund.isFalse)
|
||||||
|
)
|
||||||
.where(where)
|
.where(where)
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
|
|
|
@ -150,6 +150,7 @@ class CreatorCommunityService(
|
||||||
|
|
||||||
val postList = repository.getCommunityPostList(
|
val postList = repository.getCommunityPostList(
|
||||||
creatorId = creatorId,
|
creatorId = creatorId,
|
||||||
|
memberId = memberId,
|
||||||
offset = offset,
|
offset = offset,
|
||||||
limit = limit,
|
limit = limit,
|
||||||
isAdult = isAdult
|
isAdult = isAdult
|
||||||
|
|
Loading…
Reference in New Issue