feat(live-recommend): 추천 크리에이터 배너를 언어별로 등록하고 노출한다
This commit is contained in:
@@ -39,9 +39,10 @@ class AdminLiveController(private val service: AdminLiveService) {
|
||||
@RequestParam("creator_id") creatorId: Long,
|
||||
@RequestParam("start_date") startDate: String,
|
||||
@RequestParam("end_date") endDate: String,
|
||||
@RequestParam("is_adult") isAdult: Boolean
|
||||
@RequestParam("is_adult") isAdult: Boolean,
|
||||
@RequestParam("lang") lang: String
|
||||
) = ApiResponse.ok(
|
||||
service.createRecommendCreatorBanner(image, creatorId, startDate, endDate, isAdult),
|
||||
service.createRecommendCreatorBanner(image, creatorId, startDate, endDate, isAdult, lang),
|
||||
"등록되었습니다."
|
||||
)
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import kr.co.vividnext.sodalive.fcm.FcmDeepLinkValue
|
||||
import kr.co.vividnext.sodalive.fcm.FcmEvent
|
||||
import kr.co.vividnext.sodalive.fcm.FcmEventType
|
||||
import kr.co.vividnext.sodalive.fcm.notification.PushNotificationCategory
|
||||
import kr.co.vividnext.sodalive.i18n.Lang
|
||||
import kr.co.vividnext.sodalive.i18n.LangContext
|
||||
import kr.co.vividnext.sodalive.i18n.SodaMessageSource
|
||||
import kr.co.vividnext.sodalive.live.recommend.RecommendLiveCreatorBanner
|
||||
@@ -122,7 +123,8 @@ class AdminLiveService(
|
||||
creatorId: Long,
|
||||
startDateString: String,
|
||||
endDateString: String,
|
||||
isAdult: Boolean
|
||||
isAdult: Boolean,
|
||||
lang: String
|
||||
): Long {
|
||||
if (creatorId < 1) throw SodaException(messageKey = "admin.live.creator_required")
|
||||
|
||||
@@ -150,10 +152,17 @@ class AdminLiveService(
|
||||
if (endDate < nowDate) throw SodaException(messageKey = "admin.live.end_after_now")
|
||||
if (endDate <= startDate) throw SodaException(messageKey = "admin.live.start_before_end")
|
||||
|
||||
val bannerLang = try {
|
||||
Lang.fromCode(lang)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
throw SodaException(messageKey = "common.error.invalid_request")
|
||||
}
|
||||
|
||||
val recommendCreatorBanner = RecommendLiveCreatorBanner(
|
||||
startDate = startDate,
|
||||
endDate = endDate,
|
||||
isAdult = isAdult
|
||||
isAdult = isAdult,
|
||||
lang = bannerLang
|
||||
)
|
||||
recommendCreatorBanner.creator = creator
|
||||
recommendCreatorBannerRepository.save(recommendCreatorBanner)
|
||||
|
||||
Reference in New Issue
Block a user