routes 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. # body: com.weEat.shared.models.FoodNode
  35. # type: com.weEat.shared.models.FoodNodeId
  36. POST /v1/food/:id com.weEat.controllers.FoodController.update(id: String, uid: Option[String] ?= None)
  37. # Shared Route
  38. # type: Seq[com.weEat.shared.models.FoodNodeId]
  39. GET /v1/food/ com.weEat.controllers.FoodController.query(q: String)
  40. # Shared Route
  41. # type: Seq[com.weEat.shared.models.FoodNodeId]
  42. GET /v1/food/ com.weEat.controllers.FoodController.all()
  43. # Shared Route
  44. # type: com.weEat.shared.models.FoodNodeId
  45. GET /v1/food/:id com.weEat.controllers.FoodController.get(id: String)
  46. # Shared Route
  47. # type: com.weEat.shared.models.FoodNodeId
  48. #GET /v1/food/:id/image/:img com.weEat.controllers.FoodController.get(id: String, img: String)
  49. # Shared Route
  50. # type: com.weEat.shared.models.FoodNodeId
  51. #PUT /v1/food/:id/image com.weEat.controllers.FoodController.addImageTo(id: String)
  52. # Shared Route
  53. #DELETE /v1/food/:id/image/:img com.weEat.controllers.FoodController.deleteImage(id: String, img: String)
  54. # Shared Route
  55. # content: text
  56. # body: String
  57. # type: com.weEat.shared.models.RecipeNodeNoId
  58. POST /v1/food/recipe/parse com.weEat.controllers.ParserController.parseURL()
  59. # Shared Route
  60. # type: gov.usda.nal.fdc.models.FoodItem
  61. #GET /fdc/food com.weEat.controllers.USDAController.getFoods(id: String, fmt: String ?= "Full")
  62. # Shared Route
  63. # type: gov.usda.nal.fdc.models.SearchResult
  64. 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)
  65. # Shared Route
  66. # body: gov.usda.nal.fdc.models.FoodSearchCriteria
  67. # type: gov.usda.nal.fdc.models.SearchResult
  68. POST /fdc/food/search com.weEat.controllers.USDAController.postFoodsSearch()
  69. # Shared Route
  70. # type: Seq[gov.usda.nal.fdc.models.Nutrient]
  71. GET /fdc/nutrient com.weEat.controllers.USDAController.getNutrients()
  72. # Shared Route
  73. # type: gov.usda.nal.fdc.models.Nutrient
  74. GET /fdc/nutrient/:id com.weEat.controllers.USDAController.getNutrient(id: Int)
  75. # Shared Route
  76. # type: gov.usda.nal.fdc.models.FoodItem
  77. GET /fdc/food/:id com.weEat.controllers.USDAController.getFood(id: Long, fmt: String ?= "Full")
  78. # Map static resources from the /public folder to the /assets URL path
  79. GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
  80. # Forward Webjar requests to the webjar routes
  81. -> /webjars webjars.Routes
  82. GET /:other com.weEat.controllers.ViewController.loader(other)