FoodController.scala 586 B

12345678910111213141516171819202122232425
  1. package controllers
  2. import models.{Food,Unit,Mass,Measure}
  3. import play.api.mvc._
  4. import play.api.libs.json._
  5. class FoodController extends Controller {
  6. private def expFood() = new Food("Example",
  7. false, false, false,
  8. Map.empty,
  9. "Tom Flucke",
  10. Seq("Poultry", "Southern"),
  11. Mass,
  12. 2, 30, 1237,
  13. Nil
  14. )
  15. def put(): Action[Food] = null
  16. def update(id: Int): Action[Food] = null
  17. def get(id: Int): Action[Food] = null
  18. def query(query: String = ""): Action[AnyContent] = Action {
  19. Ok(Json.toJson(expFood))
  20. }
  21. def delete(id: Int): Action[Food] = null
  22. }