routes 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Routes
  2. # This file defines all application routes (Higher priority routes first)
  3. # https://www.playframework.com/documentation/latest/ScalaRouting
  4. # ~~~~
  5. GET / com.weEat.controllers.ViewController.index()
  6. GET /views/import com.weEat.controllers.ViewController.usdaImport()
  7. # Shared Route
  8. # body: com.weEat.shared.models.UserRegistration
  9. # type: com.weEat.shared.models.UserAuthorization
  10. PUT /user/ com.weEat.controllers.UserController.registerUser()
  11. # Shared Route
  12. # type: Seq[String]
  13. GET /user/ com.weEat.controllers.UserController.getUsers()
  14. # Shared Route
  15. # body: com.weEat.shared.models.GrantRequest
  16. # type: com.weEat.shared.models.UserAuthorization
  17. POST /authorize/ com.weEat.controllers.UserController.accessToken()
  18. # Shared Route
  19. # body: com.weEat.shared.models.RefreshRequest
  20. DELETE /authorize/ com.weEat.controllers.UserController.revokeAccessToken()
  21. # Shared Route
  22. # mime: text/plain
  23. # type: String
  24. GET /user/self/name/ com.weEat.controllers.UserController.getName()
  25. # Shared Route
  26. # body: com.weEat.shared.models.FoodNode
  27. # type: com.weEat.shared.models.FoodNode
  28. PUT /food/ com.weEat.controllers.FoodController.add()
  29. # Shared Route
  30. # type: Seq[com.weEat.shared.models.FoodNode]
  31. GET /food/ com.weEat.controllers.FoodController.query()
  32. # Shared Route
  33. # type: com.weEat.shared.models.FoodNode
  34. GET /food/:id com.weEat.controllers.FoodController.get(id: String)
  35. # Shared Route
  36. # type: gov.usda.nal.fdc.models.FoodItem
  37. GET /fdc/food com.weEat.controllers.USDAController.getFoods(id: String, fmt: String ?= "Full")
  38. # Shared Route
  39. # type: gov.usda.nal.fdc.models.SearchResult
  40. GET /fdc/food/search com.weEat.controllers.USDAController.getFoodsSearch(q: String, dataType: Seq[String] ?= Nil, pageSize: Option[Short] ?= None, pageNumber: Option[Long] ?= None, sortBy: Option[String] ?= None, sortOrder: Option[String] ?= None)
  41. # Shared Route
  42. # body: gov.usda.nal.fdc.models.FoodSearchCriteria
  43. # type: gov.usda.nal.fdc.models.SearchResult
  44. POST /fdc/food/search com.weEat.controllers.USDAController.postFoodsSearch()
  45. # Shared Route
  46. # type: Seq[gov.usda.nal.fdc.models.Nutrient]
  47. GET /fdc/nutrient com.weEat.controllers.USDAController.getNutrients()
  48. # Shared Route
  49. # type: gov.usda.nal.fdc.models.Nutrient
  50. GET /fdc/nutrient/:id com.weEat.controllers.USDAController.getNutrient(id: Int)
  51. # Shared Route
  52. # type: gov.usda.nal.fdc.models.FoodItem
  53. GET /fdc/food/:id com.weEat.controllers.USDAController.getFood(id: Long, fmt: String ?= "Full")
  54. # Map static resources from the /public folder to the /assets URL path
  55. GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
  56. # Forward Webjar requests to the webjar routes
  57. -> /webjars webjars.Routes