routes 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Routes
  2. # This file defines all application routes (Higher priority routes first)
  3. # https://www.playframework.com/documentation/latest/ScalaRouting
  4. # ~~~~
  5. GET / @controllers.Default.redirect(to = "/foodsearch?")
  6. GET /initialize com.weEat.controllers.ViewController.initalizer()
  7. POST /initialize com.weEat.controllers.ViewController.initalize()
  8. # Shared Route
  9. # body: com.weEat.shared.models.UserRegistration
  10. # type: com.weEat.shared.models.UserAuthorization
  11. PUT /v1/user/ com.weEat.controllers.UserController.registerUser()
  12. # Shared Route
  13. # type: Seq[String]
  14. GET /v1/user/ com.weEat.controllers.UserController.getUsers()
  15. # Shared Route
  16. # type: com.weEat.shared.models.User
  17. GET /v1/user/:id com.weEat.controllers.UserController.get(id: String)
  18. # Shared Route
  19. # body: com.weEat.shared.models.GrantRequest
  20. # type: com.weEat.shared.models.UserAuthorization
  21. POST /v1/authorize/ com.weEat.controllers.UserController.accessToken()
  22. # Shared Route
  23. # body: com.weEat.shared.models.RefreshRequest
  24. DELETE /v1/authorize/ com.weEat.controllers.UserController.revokeAccessToken()
  25. # Shared Route
  26. # mime: text/plain
  27. # type: String
  28. GET /v1/user/self/name/ com.weEat.controllers.UserController.getName()
  29. # Shared Route
  30. # body: com.weEat.shared.models.FoodNode
  31. # type: com.weEat.shared.models.FoodNodeId
  32. PUT /v1/food/ com.weEat.controllers.FoodController.add(uid: Option[String] ?= None)
  33. # Shared Route
  34. # type: Seq[com.weEat.shared.models.FoodNodeId]
  35. GET /v1/food/ com.weEat.controllers.FoodController.query(q: String)
  36. # Shared Route
  37. # type: Seq[com.weEat.shared.models.FoodNodeId]
  38. GET /v1/food/ com.weEat.controllers.FoodController.all()
  39. # Shared Route
  40. # type: com.weEat.shared.models.FoodNodeId
  41. GET /v1/food/:id com.weEat.controllers.FoodController.get(id: String)
  42. # Share Route
  43. # type: com.weEat.shared.models.FoodNodeId
  44. #GET /v1/food/:id/image/:img com.weEat.controllers.FoodController.get(id: String, img: String)
  45. # Share Route
  46. # type: com.weEat.shared.models.FoodNodeId
  47. #PUT /v1/food/:id/image com.weEat.controllers.FoodController.addImageTo(id: String)
  48. # Share Route
  49. #DELETE /v1/food/:id/image/:img com.weEat.controllers.FoodController.deleteImage(id: String, img: String)
  50. # Share Route
  51. # type: gov.usda.nal.fdc.models.FoodItem
  52. #GET /fdc/food com.weEat.controllers.USDAController.getFoods(id: String, fmt: String ?= "Full")
  53. # Shared Route
  54. # type: gov.usda.nal.fdc.models.SearchResult
  55. 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)
  56. # Shared Route
  57. # body: gov.usda.nal.fdc.models.FoodSearchCriteria
  58. # type: gov.usda.nal.fdc.models.SearchResult
  59. POST /fdc/food/search com.weEat.controllers.USDAController.postFoodsSearch()
  60. # Shared Route
  61. # type: Seq[gov.usda.nal.fdc.models.Nutrient]
  62. GET /fdc/nutrient com.weEat.controllers.USDAController.getNutrients()
  63. # Shared Route
  64. # type: gov.usda.nal.fdc.models.Nutrient
  65. GET /fdc/nutrient/:id com.weEat.controllers.USDAController.getNutrient(id: Int)
  66. # Shared Route
  67. # type: gov.usda.nal.fdc.models.FoodItem
  68. GET /fdc/food/:id com.weEat.controllers.USDAController.getFood(id: Long, fmt: String ?= "Full")
  69. # Map static resources from the /public folder to the /assets URL path
  70. GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
  71. # Forward Webjar requests to the webjar routes
  72. -> /webjars webjars.Routes
  73. GET /:other com.weEat.controllers.ViewController.loader(other)