Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. trait StorageService extends Plan {
  2.   implicit val formats = DefaultFormats
  3.   val identityFunction = SimpleFunction.nullary[Int]("identity")
  4.  
  5.   override def intent = {
  6.     ...
  7.     case req@PUT(Path(Seg("rest" :: "products" :: Nil))) =>
  8.       Products insertValue (read[Product](Body.string(req)))
  9.       ResponseString(write(
  10.         Query(Products).where(_.id === Query(identityFunction).first).list.head
  11.       ))
  12.     ...
  13.   }
  14. }