Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. package v1.event
  2.  
  3. import javax.inject._
  4.  
  5. import play.api.libs.json._
  6.  
  7. //import play.api.libs.json.{JsValue, Json, Writes}
  8. import play.api.mvc._
  9. import scala.concurrent.{ExecutionContext, Future}
  10. import play.api.libs.json.Json._
  11. import play.api.libs.functional.syntax._
  12.  
  13.  
  14. /**
  15. * Created by danieleobasi on 14/08/2017.
  16. */
  17. class EventController @Inject()(eventDAO: EventDAO, cc: ControllerComponents)
  18. (implicit ec: ExecutionContext)extends AbstractController(cc) {
  19.  
  20. def index = Action.async{
  21. val events = eventDAO.all().map(result => result)
  22.  
  23. eventDAO.all().map{
  24. result => Ok(Json.toJson(result))
  25. //result => Ok(Json.toJson(result)(Writes))
  26.  
  27. }
  28.  
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement