生无可恋。我尝试像在官方文档的最后一段中那样做 ActionComposition:https ://playframework.com/documentation/2.3.x/ScalaActionsComposition
我的代码:
object ActionBuilder1 extends ActionRefiner[Request, Request] {
override protected def refine[A](request: Request[A]): Future[Either[Result, Request[A]]] = Future {Right(request)}
}
object ActionBuilder2 extends ActionBuilder[Request] {
def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]) : Future[Result] = {
block(request)
}
}
在我的控制器中:
def yolo = ActionBuilder2 andThen ActionBuilder1 {
Ok("ASd")
}
但是编译器说:
actions.ActionBuilder1.type does not take parameters
def yolo = ActionBuilder2 andThen ActionBuilder1 {
^
我真的不知道为什么...