feat(event): 접속 국가별 이벤트 언어 필터를 적용한다
This commit is contained in:
+3
-2
@@ -26,9 +26,10 @@ class AdminEventBannerController(private val service: AdminEventBannerService) {
|
||||
@RequestParam(value = "isAdult", required = false) isAdult: Boolean? = null,
|
||||
@RequestParam(value = "isPopup") isPopup: Boolean,
|
||||
@RequestParam(value = "startDate") startDate: String,
|
||||
@RequestParam(value = "endDate") endDate: String
|
||||
@RequestParam(value = "endDate") endDate: String,
|
||||
@RequestParam("lang") lang: String
|
||||
) = ApiResponse.ok(
|
||||
service.save(thumbnail, detail, popup, link, title, isAdult, isPopup, startDate, endDate),
|
||||
service.save(thumbnail, detail, popup, link, title, isAdult, isPopup, startDate, endDate, lang),
|
||||
"등록되었습니다."
|
||||
)
|
||||
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ class AdminEventBannerQueryRepositoryImpl(
|
||||
QGetAdminEventResponse(
|
||||
event.id,
|
||||
event.title,
|
||||
event.lang,
|
||||
getProcessedUrlExpression(event.thumbnailImage),
|
||||
getProcessedUrlExpression(event.detailImage),
|
||||
getProcessedUrlExpression(event.popupImage),
|
||||
|
||||
+10
-1
@@ -4,6 +4,7 @@ import com.amazonaws.services.s3.model.ObjectMetadata
|
||||
import kr.co.vividnext.sodalive.aws.s3.S3Uploader
|
||||
import kr.co.vividnext.sodalive.common.SodaException
|
||||
import kr.co.vividnext.sodalive.event.Event
|
||||
import kr.co.vividnext.sodalive.i18n.Lang
|
||||
import kr.co.vividnext.sodalive.utils.generateFileName
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.data.repository.findByIdOrNull
|
||||
@@ -32,12 +33,19 @@ class AdminEventBannerService(
|
||||
isAdult: Boolean? = null,
|
||||
isPopup: Boolean,
|
||||
startDateString: String,
|
||||
endDateString: String
|
||||
endDateString: String,
|
||||
lang: String
|
||||
): Long {
|
||||
if (detail == null && link.isNullOrBlank()) {
|
||||
throw SodaException(messageKey = "admin.event.banner.detail_or_link_required")
|
||||
}
|
||||
|
||||
val eventLang = try {
|
||||
Lang.fromCode(lang)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
throw SodaException(messageKey = "common.error.invalid_request")
|
||||
}
|
||||
|
||||
val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
|
||||
val startDate = LocalDateTime.parse(startDateString, dateTimeFormatter)
|
||||
.atZone(ZoneId.of("Asia/Seoul"))
|
||||
@@ -56,6 +64,7 @@ class AdminEventBannerService(
|
||||
popupImage = null,
|
||||
link = link,
|
||||
title = title,
|
||||
lang = eventLang,
|
||||
isAdult = isAdult,
|
||||
isPopup = isPopup,
|
||||
startDate = startDate,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package kr.co.vividnext.sodalive.admin.event.banner
|
||||
|
||||
import com.querydsl.core.annotations.QueryProjection
|
||||
import kr.co.vividnext.sodalive.i18n.Lang
|
||||
|
||||
data class GetAdminEventResponse @QueryProjection constructor(
|
||||
val id: Long,
|
||||
val title: String? = null,
|
||||
val lang: Lang,
|
||||
val thumbnailImageUrl: String,
|
||||
val detailImageUrl: String? = null,
|
||||
val popupImageUrl: String? = null,
|
||||
|
||||
Reference in New Issue
Block a user