ㅎㅎㅎ
This commit is contained in:
+32
-3
@@ -4,11 +4,23 @@ import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.WindowPlacement
|
||||
import androidx.compose.ui.window.application
|
||||
import androidx.compose.ui.window.rememberWindowState
|
||||
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.serialization.json.Json
|
||||
import org.jetbrains.exposed.sql.*
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import model.AppConfig
|
||||
import model.KisSession
|
||||
import network.DartCodeManager
|
||||
import network.LlamaServerManager
|
||||
import network.NewsService
|
||||
import org.jetbrains.exposed.sql.selectAll
|
||||
@@ -19,11 +31,28 @@ import ui.SettingsScreen
|
||||
enum class AppScreen { Settings, Dashboard }
|
||||
|
||||
fun main() = application {
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
// NewsService나 KisTradeService에서 사용하는 client를 전달
|
||||
DartCodeManager.updateCorpCodes(HttpClient(CIO) {
|
||||
install(ContentNegotiation) {
|
||||
json(Json {
|
||||
ignoreUnknownKeys = true
|
||||
encodeDefaults = true // 기본값이 포함된 요청 바디를 정확히 전송하기 위해 필요
|
||||
})
|
||||
}
|
||||
// [수정] 모든 로그(Headers + Body)를 찍도록 설정
|
||||
install(Logging) {
|
||||
logger = Logger.DEFAULT
|
||||
level = LogLevel.BODY
|
||||
}
|
||||
})
|
||||
}
|
||||
// 앱 실행 시 필요한 바이너리 경로 (실행 파일 위치)
|
||||
val binPath = "./src/main/resources/bin/llama-server"
|
||||
|
||||
Window(onCloseRequest = ::exitApplication, title = "KIS AI 자동매매") {
|
||||
val windowState = rememberWindowState(
|
||||
placement = WindowPlacement.Maximized
|
||||
)
|
||||
Window(onCloseRequest = ::exitApplication, title = "KIS AI 자동매매", state = windowState) {
|
||||
var currentScreen by remember { mutableStateOf(AppScreen.Settings) }
|
||||
var isLoaded by remember { mutableStateOf(false) }
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
Reference in New Issue
Block a user