feat(agent-calculate): 소속 크리에이터 응답에 프로필 이미지를 추가한다
This commit is contained in:
@@ -15,6 +15,7 @@ import kr.co.vividnext.sodalive.live.room.QLiveRoom.liveRoom
|
||||
import kr.co.vividnext.sodalive.member.QMember.member
|
||||
import kr.co.vividnext.sodalive.partner.agent.assignment.QAgentCreatorRelation.agentCreatorRelation
|
||||
import kr.co.vividnext.sodalive.partner.agent.ratio.QAgentSettlementRatio.agentSettlementRatio
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Repository
|
||||
import java.time.LocalDateTime
|
||||
import javax.persistence.EntityManager
|
||||
@@ -22,7 +23,10 @@ import javax.persistence.EntityManager
|
||||
@Repository
|
||||
class AgentCalculateQueryRepository(
|
||||
private val queryFactory: JPAQueryFactory,
|
||||
private val entityManager: EntityManager
|
||||
private val entityManager: EntityManager,
|
||||
|
||||
@Value("\${cloud.aws.cloud-front.host}")
|
||||
private val cloudFrontHost: String
|
||||
) {
|
||||
fun getAssignedCreatorTotalCount(agentId: Long, currentTime: LocalDateTime): Int {
|
||||
return queryFactory
|
||||
@@ -46,7 +50,11 @@ class AgentCalculateQueryRepository(
|
||||
.select(
|
||||
QGetAgentAssignedCreatorItem(
|
||||
agentCreatorRelation.creator.id,
|
||||
agentCreatorRelation.creator.nickname
|
||||
agentCreatorRelation.creator.nickname,
|
||||
agentCreatorRelation.creator.profileImage
|
||||
.coalesce("profile/default-profile.png")
|
||||
.prepend("/")
|
||||
.prepend(cloudFrontHost)
|
||||
)
|
||||
)
|
||||
.from(agentCreatorRelation)
|
||||
|
||||
@@ -9,5 +9,6 @@ data class GetAgentAssignedCreatorResponse(
|
||||
|
||||
data class GetAgentAssignedCreatorItem @QueryProjection constructor(
|
||||
val creatorId: Long,
|
||||
val creatorNickname: String
|
||||
val creatorNickname: String,
|
||||
val profileImageUrl: String
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user