크리에이터 커뮤니티
- 구매한 유료게시물은 크리에이터가 삭제하더라도 조회되도록 수정
This commit is contained in:
		| @@ -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,12 +43,13 @@ 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) |             .or(useCan.communityPost.isNotNull) | ||||||
|  |  | ||||||
|         if (!isAdult) { |         if (!isAdult) { | ||||||
|             where = where.and(creatorCommunity.isAdult.isFalse) |             where = where.and(creatorCommunity.isAdult.isFalse) | ||||||
| @@ -67,7 +70,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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user