package dev.inmo.postssystem.server

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.io.File

@Serializable
data class Config(
    val host: String = "0.0.0.0",
    val port: Int = 8080,
    @SerialName("database")
    val databaseConfig: DatabaseConfig = DatabaseConfig(),
    @SerialName("auth")
    val authConfig: AuthConfig = AuthConfig(),
    val filesFolder: String,
    val debugMode: Boolean = false
) {
    val filesFolderFile: File
        get() = File(filesFolder)

    val commonFilesFolder: File
        get() = File(filesFolderFile, "common").also { it.mkdirs() }
    val binaryFilesFolder: File
        get() = File(filesFolderFile, "binary_content").also { it.mkdirs() }
}
