lunaticbum 62475fde46 ..
2024-10-02 18:15:35 +09:00

73 lines
1.9 KiB
Kotlin

package kr.lunaticbum.back.lun
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.EnvironmentAware
import org.springframework.core.env.Environment
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.stereotype.Component
@EnableScheduling // 추가
@SpringBootApplication
class LunApplication() {
}
//@Component
//class GEnv : EnvironmentAware {
// @Value("\${telegram.bot.key}")
// var telegramBotKey: String? = ""
//
// @Value("\${telegram.my.id}")
// var telegramMyId: String? = ""
//
// @Value("\${weather.api.key}")
// var weatherApiKey: String? = ""
//
//
// override fun setEnvironment(environment: Environment) {
// println ("telegramBotKey $telegramBotKey")
// println("telegramMyId $telegramMyId")
// println("weatherApiKey $weatherApiKey")
// }
//}
fun main(args: Array<String>) {
// val props = System.getProperties()
// val enumerator = props.keys()
// while (enumerator.hasMoreElements()) {
// val ele = enumerator.nextElement()
// val key = ele.toString()
// println(key + ": " + System.getProperty(key))
// }
args.forEach {
println("main ARG >> $it")
}
runApplication<LunApplication>(*args)
}
//
//@SpringBootApplication
//class Application {
// @Bean
// fun commandLineRunner(ctx: ApplicationContext): CommandLineRunner {
// return CommandLineRunner { args: Array<String?>? ->
// println("Let's inspect the beans provided by Spring Boot:")
// val beanNames: Array<String> = ctx.getBeanDefinitionNames()
// Arrays.sort(beanNames)
// for (beanName in beanNames) {
// println(beanName)
// }
// }
// }
//
// companion object {
// @JvmStatic
// fun main(args: Array<String>) {
// SpringApplication.run(Application::class.java, *args)
// }
// }
//}