diff --git a/api/src/main/kotlin/router/MainRouter.kt b/api/src/main/kotlin/router/MainRouter.kt index 30d4cf51..fba5e7aa 100644 --- a/api/src/main/kotlin/router/MainRouter.kt +++ b/api/src/main/kotlin/router/MainRouter.kt @@ -38,7 +38,10 @@ import com.wafflestudio.snu4t.router.docs.ThemeDocs import com.wafflestudio.snu4t.router.docs.TimetableDocs import com.wafflestudio.snu4t.router.docs.UserDocs import com.wafflestudio.snu4t.router.docs.VacancyNotificationDocs +import kotlinx.coroutines.reactor.awaitSingle import org.springframework.context.annotation.Bean +import org.springframework.core.io.ClassPathResource +import org.springframework.http.MediaType import org.springframework.stereotype.Component import org.springframework.web.reactive.function.server.CoRouterFunctionDsl import org.springframework.web.reactive.function.server.ServerResponse @@ -313,6 +316,20 @@ class MainRouter( } } + // TODO: 웹 api 사용 확인 후 삭제 + @Bean + fun legacyRouter() = + v1CoRouter { + GET("/colors/vivid_ios") { + val jsonContent = + ClassPathResource("vivid_ios_color.json").inputStream.bufferedReader().use { it.readText() } + ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) // Content-Type 설정 + .bodyValue(jsonContent) + .awaitSingle() + } + } + private fun v1CoRouter(r: CoRouterFunctionDsl.() -> Unit) = coRouter { path("/v1").or("").nest(r) diff --git a/api/src/main/resources/static/vivid_ios_color.json b/api/src/main/resources/static/vivid_ios_color.json new file mode 100644 index 00000000..a13bd84a --- /dev/null +++ b/api/src/main/resources/static/vivid_ios_color.json @@ -0,0 +1,14 @@ +{ + "colors": [ + { "fg": "#ffffff", "bg": "#e54459" }, + { "fg": "#ffffff", "bg": "#f58d3d" }, + { "fg": "#ffffff", "bg": "#fac52d" }, + { "fg": "#ffffff", "bg": "#a6d930" }, + { "fg": "#ffffff", "bg": "#2bc366" }, + { "fg": "#ffffff", "bg": "#1bd0c9" }, + { "fg": "#ffffff", "bg": "#1d99e9" }, + { "fg": "#ffffff", "bg": "#4f48c4" }, + { "fg": "#ffffff", "bg": "#af56b3" } + ], + "names": ["석류", "감귤", "들국", "완두", "비취", "지중해", "하늘", "라벤더", "자수정"] +}