我一直在玩Play!框架为斯卡拉现在将近一年.我目前正在使用2.5.x版.
我知道Play中控制器的发展以及开发人员如何被迫远离静态object
路由.
我也知道Guice在游戏中的用法.
如果您下载激活器并运行:
activator new my-test-app play-scala
Run Code Online (Sandbox Code Playgroud)
Activator将为您生成模板项目.我的问题是围绕该模板的这个文件.
我的测试,应用程序/应用程序/服务/ Counter.scala
package services
import java.util.concurrent.atomic.AtomicInteger
import javax.inject._
/**
* This trait demonstrates how to create a component that is injected
* into a controller. The trait represents a counter that returns a
* incremented number each time it is called.
*/
trait Counter {
def nextCount(): Int
}
/**
* This class is a …
Run Code Online (Sandbox Code Playgroud)