【发布时间】:2023-03-07 08:31:01
【问题描述】:
有什么方法可以得到LagomApplicationContext?我想使用播放配置对象play.api.Configuration 形式playContext - 组合:
sealed trait LagomApplicationContext {
/**
* The Play application loader context.
*/
val playContext: Context
}
有什么想法或建议吗?是否存在一些 DI?
我需要使用 application.conf 中的值,就像在这个例子中一样: https://www.webkj.com/play-framework/play-scala-2.5-reading-config-using-di
【问题讨论】:
-
play.api.Configuration 可以直接注入到你的类构造函数中。