Created
November 27, 2020 20:59
-
-
Save billydh/43b40a6e4d655eaa57fd033c199f5c2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thecodebrews.kotlinspringvaluedemo | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.runApplication | |
import javax.annotation.PostConstruct | |
@SpringBootApplication | |
class KotlinspringvaluedemoApplication { | |
@Value("\${store.name}") | |
val storeName: String = "" | |
@Value("\${store.address}") | |
val storeAddress: String = "" | |
@PostConstruct | |
fun getStoreInfo(): Unit { | |
println("Store name: $storeName") | |
println("Store address: $storeAddress") | |
} | |
} | |
fun main(args: Array<String>) { | |
runApplication<KotlinspringvaluedemoApplication>(*args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment