Compare commits
2 Commits
b7610641e5
...
dce1abaeff
Author | SHA1 | Date |
---|---|---|
|
dce1abaeff | |
|
c4602369ae |
|
@ -679,7 +679,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
audioContent.price,
|
audioContent.price,
|
||||||
audioContent.duration,
|
audioContent.duration,
|
||||||
member.id,
|
member.id,
|
||||||
member.nickname
|
member.nickname,
|
||||||
|
member.profileImage.prepend("/").prepend(imageHost)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -17,5 +17,6 @@ data class GetAudioContentRankingItem @QueryProjection constructor(
|
||||||
@JsonProperty("price") val price: Int,
|
@JsonProperty("price") val price: Int,
|
||||||
@JsonProperty("duration") val duration: String,
|
@JsonProperty("duration") val duration: String,
|
||||||
@JsonProperty("creatorId") val creatorId: Long,
|
@JsonProperty("creatorId") val creatorId: Long,
|
||||||
@JsonProperty("creatorNickname") val creatorNickname: String
|
@JsonProperty("creatorNickname") val creatorNickname: String,
|
||||||
|
@JsonProperty("creatorProfileImageUrl") val creatorProfileImageUrl: String
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package kr.co.vividnext.sodalive.content.main.tab
|
||||||
|
|
||||||
|
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||||
|
|
||||||
|
data class GetPopularContentByCreatorResponse(
|
||||||
|
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||||
|
val salesCountRankContentList: List<GetAudioContentRankingItem>
|
||||||
|
)
|
|
@ -6,6 +6,7 @@ import kr.co.vividnext.sodalive.member.Member
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal
|
import org.springframework.security.core.annotation.AuthenticationPrincipal
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam
|
||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -19,4 +20,19 @@ class AudioContentMainTabHomeController(private val service: AudioContentMainTab
|
||||||
|
|
||||||
ApiResponse.ok(service.fetchData(member))
|
ApiResponse.ok(service.fetchData(member))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/popular-content-by-creator")
|
||||||
|
fun getPopularContentByCreator(
|
||||||
|
@RequestParam creatorId: Long,
|
||||||
|
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||||
|
) = run {
|
||||||
|
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||||
|
|
||||||
|
ApiResponse.ok(
|
||||||
|
service.getPopularContentByCreator(
|
||||||
|
creatorId = creatorId,
|
||||||
|
isAdult = member.auth != null
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package kr.co.vividnext.sodalive.content.main.tab.home
|
package kr.co.vividnext.sodalive.content.main.tab.home
|
||||||
|
|
||||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||||
|
import kr.co.vividnext.sodalive.content.main.tab.GetPopularContentByCreatorResponse
|
||||||
import kr.co.vividnext.sodalive.event.EventService
|
import kr.co.vividnext.sodalive.event.EventService
|
||||||
import kr.co.vividnext.sodalive.member.Member
|
import kr.co.vividnext.sodalive.member.Member
|
||||||
import kr.co.vividnext.sodalive.notice.ServiceNoticeService
|
import kr.co.vividnext.sodalive.notice.ServiceNoticeService
|
||||||
|
@ -114,4 +115,21 @@ class AudioContentMainTabHomeService(
|
||||||
salesCountRankContentList = salesCountRankContentList
|
salesCountRankContentList = salesCountRankContentList
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): GetPopularContentByCreatorResponse {
|
||||||
|
val salesRankContentList = rankingService.fetchCreatorContentBySalesTop2(
|
||||||
|
creatorId = creatorId,
|
||||||
|
isAdult = isAdult
|
||||||
|
)
|
||||||
|
|
||||||
|
val salesCountRankContentList = rankingService.fetchCreatorContentBySalesCountTop2(
|
||||||
|
creatorId = creatorId,
|
||||||
|
isAdult = isAdult
|
||||||
|
)
|
||||||
|
|
||||||
|
return GetPopularContentByCreatorResponse(
|
||||||
|
salesRankContentList = salesRankContentList,
|
||||||
|
salesCountRankContentList = salesCountRankContentList
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,8 @@ class RankingRepository(
|
||||||
audioContent.price,
|
audioContent.price,
|
||||||
audioContent.duration,
|
audioContent.duration,
|
||||||
member.id,
|
member.id,
|
||||||
member.nickname
|
member.nickname,
|
||||||
|
member.profileImage.prepend("/").prepend(imageHost)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -365,7 +366,8 @@ class RankingRepository(
|
||||||
audioContent.price,
|
audioContent.price,
|
||||||
audioContent.duration,
|
audioContent.duration,
|
||||||
member.id,
|
member.id,
|
||||||
member.nickname
|
member.nickname,
|
||||||
|
member.profileImage.prepend("/").prepend(imageHost)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.from(order)
|
.from(order)
|
||||||
|
@ -404,7 +406,8 @@ class RankingRepository(
|
||||||
audioContent.price,
|
audioContent.price,
|
||||||
audioContent.duration,
|
audioContent.duration,
|
||||||
member.id,
|
member.id,
|
||||||
member.nickname
|
member.nickname,
|
||||||
|
member.profileImage.prepend("/").prepend(imageHost)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.from(order)
|
.from(order)
|
||||||
|
|
Loading…
Reference in New Issue