Merge pull request 'test' (#41) from test into main

Reviewed-on: #41
This commit is contained in:
klaus 2023-10-06 08:50:32 +00:00
commit 51fd5408dc
7 changed files with 43 additions and 14 deletions

View File

@ -628,4 +628,12 @@ class ExplorerQueryRepository(
) )
.fetchFirst() .fetchFirst()
} }
fun getVisibleDonationRank(creatorId: Long): Boolean {
return queryFactory
.select(member.isVisibleDonationRank)
.from(member)
.where(member.id.eq(creatorId))
.fetchFirst()
}
} }

View File

@ -178,11 +178,15 @@ class ExplorerService(
val notificationRecipientCount = notificationUserIds.size val notificationRecipientCount = notificationUserIds.size
// 후원랭킹 // 후원랭킹
val memberDonationRanking = queryRepository.getMemberDonationRanking( val memberDonationRanking = if (creatorId == member.id!! || creatorAccount.isVisibleDonationRank) {
creatorId, queryRepository.getMemberDonationRanking(
10, creatorId,
withDonationCan = creatorId == member.id!! 10,
) withDonationCan = creatorId == member.id!!
)
} else {
listOf()
}
// 추천 크리에이터 // 추천 크리에이터
val similarCreatorList = queryRepository.getSimilarCreatorList(creatorId) val similarCreatorList = queryRepository.getSimilarCreatorList(creatorId)
@ -290,6 +294,11 @@ class ExplorerService(
} else { } else {
0 0
}, },
isVisibleDonationRank = if (creatorId == member.id!!) {
queryRepository.getVisibleDonationRank(creatorId)
} else {
false
},
totalCount = queryRepository.getMemberDonationRankingTotal(creatorId), totalCount = queryRepository.getMemberDonationRankingTotal(creatorId),
userDonationRanking = queryRepository.getMemberDonationRanking( userDonationRanking = queryRepository.getMemberDonationRanking(
creatorId, creatorId,

View File

@ -4,6 +4,7 @@ data class GetDonationAllResponse(
val accumulatedCansToday: Int, val accumulatedCansToday: Int,
val accumulatedCansLastWeek: Int, val accumulatedCansLastWeek: Int,
val accumulatedCansThisMonth: Int, val accumulatedCansThisMonth: Int,
val isVisibleDonationRank: Boolean,
val totalCount: Int, val totalCount: Int,
val userDonationRanking: List<MemberDonationRankingResponse> val userDonationRanking: List<MemberDonationRankingResponse>
) )

View File

@ -653,15 +653,19 @@ class LiveRoomService(
.getNotificationUserIds(room.member!!.id!!) .getNotificationUserIds(room.member!!.id!!)
.contains(member.id) .contains(member.id)
val donationRankingTop3UserIds = explorerQueryRepository val donationRankingTop3UserIds = if (room.member!!.isVisibleDonationRank) {
.getMemberDonationRanking( explorerQueryRepository
room.member!!.id!!, .getMemberDonationRanking(
3, room.member!!.id!!,
withDonationCan = false 3,
) withDonationCan = false
.asSequence() )
.map { it.userId } .asSequence()
.toList() .map { it.userId }
.toList()
} else {
listOf()
}
return GetRoomInfoResponse( return GetRoomInfoResponse(
roomId = roomId, roomId = roomId,

View File

@ -28,6 +28,8 @@ data class Member(
@Enumerated(value = EnumType.STRING) @Enumerated(value = EnumType.STRING)
var role: MemberRole = MemberRole.USER, var role: MemberRole = MemberRole.USER,
var isVisibleDonationRank: Boolean = true,
var isActive: Boolean = true, var isActive: Boolean = true,
var container: String = "web" var container: String = "web"

View File

@ -547,6 +547,10 @@ class MemberService(
member.blogUrl = profileUpdateRequest.blogUrl member.blogUrl = profileUpdateRequest.blogUrl
} }
if (profileUpdateRequest.isVisibleDonationRank != null) {
member.isVisibleDonationRank = profileUpdateRequest.isVisibleDonationRank
}
return ProfileResponse(member, cloudFrontHost, profileUpdateRequest.container) return ProfileResponse(member, cloudFrontHost, profileUpdateRequest.container)
} }

View File

@ -13,5 +13,6 @@ data class ProfileUpdateRequest(
val instagramUrl: String? = null, val instagramUrl: String? = null,
val websiteUrl: String? = null, val websiteUrl: String? = null,
val blogUrl: String? = null, val blogUrl: String? = null,
val isVisibleDonationRank: Boolean? = null,
val container: String val container: String
) )