我以这种方式设置应用程序加载器:
class MyProjectApplicationLoader extends ApplicationLoader {
def load(context: Context): Application = new ApplicationComponents(context).application
}
class ApplicationComponents(context: Context) extends BuiltInComponentsFromContext(context)
with QAControllerModule
with play.filters.HttpFiltersComponents {
// set up logger
LoggerConfigurator(context.environment.classLoader).foreach {
_.configure(context.environment, context.initialConfiguration, Map.empty)
}
lazy val router: Router = {
// add the prefix string in local scope for the Routes constructor
val prefix: String = "/"
wire[Routes]
}
}
但我的路线是自定义的,所以它看起来像:
routes
文件:
-> /myApi/v1 v1.Routes
-> /MyHealthcheck HealthCheck.Routes
和我的v1.Routes
文件:
GET /getData controllers.MyController.getData
所以现在当我编译项目时,我得到了这个错误:
错误:找不到类型的值:[v1.Routes] 线 [Routes]
所以我不知道如何解决这个问题,有人知道我怎样才能让加载器使用这种路由结构吗?