feat(home): 팔로잉 탭 최근 소식 정책을 보강한다
This commit is contained in:
+27
-1
@@ -14,6 +14,8 @@ import kr.co.vividnext.sodalive.member.following.CreatorFollowing
|
||||
import kr.co.vividnext.sodalive.support.EmbeddedRedisInitializer
|
||||
import kr.co.vividnext.sodalive.v2.home.following.adapter.out.persistence.HomeFollowingNewsInbox
|
||||
import kr.co.vividnext.sodalive.v2.home.following.domain.FollowingNewsType
|
||||
import kr.co.vividnext.sodalive.v2.ranking.adapter.out.persistence.CreatorRankingSnapshot
|
||||
import kr.co.vividnext.sodalive.v2.ranking.domain.CreatorRankingType
|
||||
import kr.co.vividnext.sodalive.v2.usercreatorchat.UserCreatorChatMessage
|
||||
import kr.co.vividnext.sodalive.v2.usercreatorchat.UserCreatorChatMessageType
|
||||
import kr.co.vividnext.sodalive.v2.usercreatorchat.UserCreatorChatParticipant
|
||||
@@ -167,7 +169,9 @@ class HomeFollowingEndToEndTest @Autowired constructor(
|
||||
newsType = FollowingNewsType.COMMUNITY_POST,
|
||||
targetId = paidPost.id!!
|
||||
)
|
||||
val rankedNews = saveNews(viewer.id!!, creator.id!!, "ranked-news", now.minusHours(1), rank = 7)
|
||||
val rankedVisibleFromAtUtc = now.minusHours(1)
|
||||
saveCreatorRankingSnapshot(creator, rankNo = 7, visibleFromAtUtc = rankedVisibleFromAtUtc)
|
||||
val rankedNews = saveNews(viewer.id!!, creator.id!!, "ranked-news", rankedVisibleFromAtUtc, rank = 7)
|
||||
val chatRoom = saveDmChatRoom(viewer, creator, now.minusMinutes(10))
|
||||
entityManager.flush()
|
||||
entityManager.clear()
|
||||
@@ -275,6 +279,28 @@ class HomeFollowingEndToEndTest @Autowired constructor(
|
||||
return news
|
||||
}
|
||||
|
||||
private fun saveCreatorRankingSnapshot(
|
||||
creator: Member,
|
||||
rankNo: Int,
|
||||
visibleFromAtUtc: LocalDateTime
|
||||
): CreatorRankingSnapshot {
|
||||
val snapshot = CreatorRankingSnapshot(
|
||||
rankingType = CreatorRankingType.WEEKLY,
|
||||
aggregationStartAtUtc = visibleFromAtUtc.minusWeeks(1),
|
||||
aggregationEndAtUtc = visibleFromAtUtc,
|
||||
visibleFromAtUtc = visibleFromAtUtc,
|
||||
creatorId = creator.id!!,
|
||||
nickname = creator.nickname,
|
||||
profileImageUrl = creator.profileImage,
|
||||
rankNo = rankNo,
|
||||
finalScore = 100.0 - rankNo,
|
||||
scorePolicyVersion = "v1",
|
||||
scoreDetailJson = "{}"
|
||||
)
|
||||
entityManager.persist(snapshot)
|
||||
return snapshot
|
||||
}
|
||||
|
||||
private fun saveCommunityPost(creator: Member, content: String, price: Int, imagePath: String): CreatorCommunity {
|
||||
val post = CreatorCommunity(
|
||||
content = content,
|
||||
|
||||
Reference in New Issue
Block a user