...
This commit is contained in:
@@ -16,9 +16,19 @@ import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.engine.cio.CIO
|
||||
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
|
||||
import io.ktor.client.plugins.logging.DEFAULT
|
||||
import io.ktor.client.plugins.logging.LogLevel
|
||||
import io.ktor.client.plugins.logging.Logger
|
||||
import io.ktor.client.plugins.logging.Logging
|
||||
import io.ktor.serialization.kotlinx.json.json
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.serialization.json.Json
|
||||
import model.AppConfig
|
||||
import model.KisSession
|
||||
import network.DartCodeManager
|
||||
import network.KisAuthService
|
||||
import network.KisTradeService
|
||||
import org.jetbrains.exposed.sql.deleteAll
|
||||
@@ -83,6 +93,10 @@ fun SettingsScreen(onAuthSuccess: () -> Unit) {
|
||||
|
||||
Divider(Modifier.padding(vertical = 16.dp))
|
||||
|
||||
OutlinedTextField(value = config.nAppKey, onValueChange = { config = config.copy(nAppKey = it,) }, label = { Text("NAVER Client ID") }, modifier = Modifier.fillMaxWidth())
|
||||
OutlinedTextField(value = config.nSecretKey, onValueChange = { config = config.copy(nSecretKey = it,) }, label = { Text("NAVER Client Secret") }, modifier = Modifier.fillMaxWidth(), visualTransformation = PasswordVisualTransformation())
|
||||
OutlinedTextField(value = config.dAppKey, onValueChange = { config = config.copy(dAppKey = it,) }, label = { Text("Dart ApiKey") }, modifier = Modifier.fillMaxWidth())
|
||||
|
||||
// AI 모델 경로 및 드래그 앤 드롭
|
||||
Text("AI 모델 설정", fontWeight = FontWeight.Bold)
|
||||
Box(
|
||||
@@ -122,6 +136,19 @@ fun SettingsScreen(onAuthSuccess: () -> Unit) {
|
||||
// 1. KisSession.config 업데이트 및 DB 저장
|
||||
KisSession.config = config
|
||||
DatabaseFactory.saveConfig(config)
|
||||
DartCodeManager.updateCorpCodes(HttpClient(CIO) {
|
||||
install(ContentNegotiation) {
|
||||
json(Json {
|
||||
ignoreUnknownKeys = true
|
||||
encodeDefaults = true // 기본값이 포함된 요청 바디를 정확히 전송하기 위해 필요
|
||||
})
|
||||
}
|
||||
// [수정] 모든 로그(Headers + Body)를 찍도록 설정
|
||||
install(Logging) {
|
||||
logger = Logger.DEFAULT
|
||||
level = LogLevel.BODY
|
||||
}
|
||||
})
|
||||
val authService = KisAuthService
|
||||
val tradeService = KisTradeService
|
||||
val authSuccess = authService.refreshAllTokens()
|
||||
|
||||
Reference in New Issue
Block a user