From f3282582e34f70d66cc95e0f72cf90d48ca2144f Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Fri, 3 Nov 2023 17:49:11 +0100 Subject: [PATCH] refactor: changing locale param to lang --- .version | 2 +- Makefile | 1 + .../daithi/electricityprices/ElectricityPricesApplication.kt | 2 +- .../electricityprices/web/controller/AlexaSkillController.kt | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.version b/.version index 092afa1..84cc529 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.17.0 +1.18.0 diff --git a/Makefile b/Makefile index 17cc65d..449f5eb 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,6 @@ help: build: #@ Build local ./gradlew clean build +.PHONY:build image: #@ Build docker image docker build -t electricity-prices . --load diff --git a/src/main/kotlin/ie/daithi/electricityprices/ElectricityPricesApplication.kt b/src/main/kotlin/ie/daithi/electricityprices/ElectricityPricesApplication.kt index 523fafe..dfd47a9 100644 --- a/src/main/kotlin/ie/daithi/electricityprices/ElectricityPricesApplication.kt +++ b/src/main/kotlin/ie/daithi/electricityprices/ElectricityPricesApplication.kt @@ -10,7 +10,7 @@ import org.springframework.boot.runApplication info = Info( title = "Electricity Prices API", - version = "1.17.0", + version = "1.18.0", description = "Returns PVPC electricity prices for a given range" ), servers = [ diff --git a/src/main/kotlin/ie/daithi/electricityprices/web/controller/AlexaSkillController.kt b/src/main/kotlin/ie/daithi/electricityprices/web/controller/AlexaSkillController.kt index 2264b3a..08dfd4f 100644 --- a/src/main/kotlin/ie/daithi/electricityprices/web/controller/AlexaSkillController.kt +++ b/src/main/kotlin/ie/daithi/electricityprices/web/controller/AlexaSkillController.kt @@ -39,8 +39,8 @@ class AlexaSkillController( ApiResponse(responseCode = "200", description = "Request successful") ) @ResponseBody - fun getFullFeed(@RequestParam(value = "locale", required = false) locale: String?): AlexaSkillResponse { - val resolvedLocale = locale?.let { Locale.forLanguageTag(it) } ?: Locale.forLanguageTag("es") + fun getFullFeed(@RequestParam(value = "lang", required = false) lang: String?): AlexaSkillResponse { + val resolvedLocale = lang?.let { Locale.forLanguageTag(it) } ?: Locale.forLanguageTag("es") return wrapInSkillResponse( message = alexSkillService.getFullFeed(resolvedLocale), title = messageSource.getMessage("alexa.full.title", emptyArray(), resolvedLocale)