我玩命令模型結合我看着例子github上的項目,我使用的依賴,當有問題:Scalatra的數據綁定
"org.scalatra" % "scalatra-data-binding" % "2.2.0-RC1"
以示例項目代碼,即
abstract class TodosCommand[S](implicit mf: Manifest[S]) extends ModelCommand[S] with ParamsOnlyCommand
class CreateTodoCommand extends TodosCommand[Todo] {
val name: Field[String] = asType[String]("name").notBlank.minLength(3)
}
case class Todo(id: Integer, name: String, done: Boolean = false)
當我使用命令[CreateTodoCommand] CommandSupport特性的命令時,我無法編譯,例如:
scala: type arguments [au.com.xxx.sapi.seo.CreateTodoCommand] do not conform to method command's type parameter bounds [T <: SeoServlet.this.CommandType]
val cmd = command[CreateTodoCommand]
^
我不是避讓使用Scala,但我會假設,如ParamsOnlyCommand擴展命令並沒有這一行命令支持特性,那麼就應該沒有問題:
type CommandType <: org.scalatra.databinding.Command
任何想法,爲什麼我收到這個問題?
乾杯,克里斯。
我結束了使用Scalatra 2.2.1和「org.scalatra」%%「scalatra-commands」%「2.2.0」依賴關係,但幾乎沒有問題。 – Owen