def edit(id: String) = SecuredAction(WithService("master")).async {隐式请求 =>
val futureEmp = collection.flatMap(_.find(Json.obj("_id" -> Json.obj("$oid" -> id))).cursor[Employee]().collect[List]())
futureEmp.map { emps: List[Employee] =>
implicit val message = messagesApi.preferred(request)
Ok(html.editForm(id, employeeForm.fill(emps.head)))
}.recover {
case t: TimeoutException =>
Logger.error("Problem found in employee edit process")
InternalServerError(t.getMessage)
}
}