feat(ai-character): 관리자 API Phase 1 기반을 추가한다

This commit is contained in:
2026-07-26 05:01:34 +09:00
parent d3564f8c0d
commit 0d2742756f
19 changed files with 4108 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.configs
import kr.co.vividnext.sodalive.common.CountryInterceptor
import kr.co.vividnext.sodalive.i18n.LangInterceptor
import org.springframework.context.annotation.Configuration
import org.springframework.web.cors.CorsConfiguration
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@@ -18,15 +19,49 @@ class WebConfig(
}
override fun addCorsMappings(registry: CorsRegistry) {
listOf("/admin/member/login", "/member/logout").forEach { path ->
registry.addMapping(path)
.allowedOrigins(*AI_CHARACTER_ADMIN_SHARED_AUTH_ALLOWED_ORIGINS.toTypedArray())
.allowedMethods("*")
.allowCredentials(true)
}
registry.addMapping("/api/v2/admin/ai-characters/**")
.allowedOrigins(*AI_CHARACTER_ADMIN_ALLOWED_ORIGINS.toTypedArray())
.allowedMethods("*")
.allowCredentials(true)
registry.addMapping("/**")
.allowedOrigins(
"http://localhost:8888",
"https://creator.sodalive.net",
"https://test-creator.sodalive.net",
"https://test-admin.sodalive.net",
"https://admin.sodalive.net"
)
.allowedOrigins(*ALLOWED_ORIGINS.toTypedArray())
.allowedMethods("*")
.allowCredentials(true)
}
companion object {
private val ALLOWED_ORIGINS = listOf(
"http://localhost:8888",
"https://creator.sodalive.net",
"https://test-creator.sodalive.net",
"https://test-admin.sodalive.net",
"https://admin.sodalive.net"
)
private val AI_CHARACTER_ADMIN_ALLOWED_ORIGINS = listOf(
"http://localhost:8888",
"https://test-character-admin.sodalive.net",
"https://character-admin.sodalive.net"
)
private val AI_CHARACTER_ADMIN_SHARED_AUTH_ALLOWED_ORIGINS =
(ALLOWED_ORIGINS + AI_CHARACTER_ADMIN_ALLOWED_ORIGINS).distinct()
internal fun createAiCharacterAdminCorsConfiguration(): CorsConfiguration {
return CorsConfiguration().apply {
applyPermitDefaultValues()
allowedOrigins = AI_CHARACTER_ADMIN_ALLOWED_ORIGINS
allowedMethods = listOf(CorsConfiguration.ALL)
allowCredentials = true
}
}
}
}