Configannotation使用Scala宏特性实现配置项映射
示例代码:
import com.wacai.config.annotation._class Server { @conf val port = 0}// application.confserver { port = 8080}//@conf will let scala compile to transform val port = 0 to :val port = config.getInt("server.port")
评论