feat(creator-channel): 후원 탭 legacy 랭킹 adapter를 추가한다
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package kr.co.vividnext.sodalive.v2.creator.channel.donation.adapter.out.legacy
|
||||
|
||||
import kr.co.vividnext.sodalive.explorer.profile.CreatorDonationRankingService
|
||||
import kr.co.vividnext.sodalive.member.DonationRankingPeriod
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.donation.port.out.CreatorChannelDonationRankingPort
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.donation.port.out.CreatorChannelDonationRankingRecord
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class LegacyCreatorChannelDonationRankingAdapter(
|
||||
private val creatorDonationRankingService: CreatorDonationRankingService
|
||||
) : CreatorChannelDonationRankingPort {
|
||||
override fun findTopRankings(
|
||||
creatorId: Long,
|
||||
period: DonationRankingPeriod,
|
||||
withDonationCan: Boolean
|
||||
): List<CreatorChannelDonationRankingRecord> {
|
||||
return creatorDonationRankingService.getMemberDonationRanking(
|
||||
creatorId = creatorId,
|
||||
offset = 0L,
|
||||
limit = 8L,
|
||||
withDonationCan = withDonationCan,
|
||||
period = period
|
||||
).map {
|
||||
CreatorChannelDonationRankingRecord(
|
||||
userId = it.userId,
|
||||
nickname = it.nickname,
|
||||
profileImage = it.profileImage,
|
||||
donationCan = it.donationCan
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user