라이브 메인 - 추천라이브, 추천채널, 예약중인 라이브, 진행중인 라이브, 이벤트 배너 API 추가

This commit is contained in:
2023-07-27 06:24:23 +09:00
parent ee124e258e
commit ee99dd3147
20 changed files with 757 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package kr.co.vividnext.sodalive.event
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
@Service
class EventService(
private val repository: EventRepository,
@Value("\${cloud.aws.cloud-front.host}")
private val cloudFrontHost: String
) {
fun getEventList(): GetEventResponse {
val eventList = repository.getEventList()
.asSequence()
.map {
if (!it.thumbnailImageUrl.startsWith("https://")) {
it.thumbnailImageUrl = "$cloudFrontHost/${it.thumbnailImageUrl}"
}
if (it.detailImageUrl != null && !it.detailImageUrl!!.startsWith("https://")) {
it.detailImageUrl = "$cloudFrontHost/${it.detailImageUrl}"
}
if (it.popupImageUrl != null && !it.popupImageUrl!!.startsWith("https://")) {
it.popupImageUrl = "$cloudFrontHost/${it.popupImageUrl}"
}
it
}
.toList()
return GetEventResponse(0, eventList)
}
}