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