You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

198 lines
11 KiB

4 years ago
4 years ago
4 years ago
  1. <?php
  2. /** @var \Illuminate\Routing\$router */
  3. $router->group(['prefix' => 'actions'], function () use ($router) {
  4. $router->group(['prefix' => 'businesses'], function () use ($router) {
  5. $router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
  6. $router->get('/info', 'BusinessController@info');
  7. });
  8. });
  9. });
  10. $router->get('/callback', 'CreditController@callback');
  11. $router->get('/{transaction}/redirection', 'CreditController@redirection');
  12. $router->group(['prefix' => 'auth'], function () use ($router) {
  13. $router->get('/', 'AuthController@auth')->middleware('auth:api');
  14. $router->delete('/', 'AuthController@delete');
  15. $router->get('/info', 'AuthController@authWithInfo')->middleware('auth:api');
  16. $router->post('login', 'AuthController@login');
  17. $router->post('logout', 'AuthController@logout')->middleware('auth:api');
  18. $router->post('register', 'AuthController@register');
  19. $router->post('revoke/{token}', 'AuthController@revoke');
  20. $router->post('forget-password', 'AuthController@forgetPassword');
  21. $router->post('update-password', 'AuthController@updatePassword');
  22. $router->post('verification', 'AuthController@verification');
  23. $router->get('google/redirect', 'AuthController@redirectToGoogle')->name('google.redirect');
  24. $router->get('google/callback', 'AuthController@handleGoogleCallback')->name('google.callback');
  25. });
  26. $router->group(['prefix' => 'businesses', 'middleware' => 'auth:api'], function () use ($router) {
  27. $router->get('/', 'BusinessController@index');
  28. $router->post('/', 'BusinessController@store');
  29. $router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
  30. $router->get('/tasks', 'TaskController@index');
  31. $router->get('/works', 'WorkController@index');
  32. $router->get('statistics', 'StatisticController@index');
  33. $router->put('/avatar', 'BusinessController@setAvatar');
  34. $router->delete('/avatar', 'BusinessController@unSetAvatar');
  35. $router->get('/', 'BusinessController@show');
  36. $router->put('/', 'BusinessController@update');
  37. $router->delete('/', 'BusinessController@delete');
  38. $router->get('/restore', 'BusinessController@restore');
  39. $router->get('/files', 'FileController@index');
  40. $router->get('/info', 'BusinessController@info');
  41. $router->get('/invoices', 'InvoiceController@index');
  42. $router->get('/invoices/{date}', 'InvoiceController@show');
  43. $router->get('/pay', 'CreditController@pay');
  44. $router->get('/payments', 'CreditController@payments');
  45. $router->group(['prefix' => 'projects'], function () use ($router) {
  46. $router->get('/', 'ProjectController@index');
  47. $router->post('/', 'ProjectController@store');
  48. $router->group(['prefix' => '{project}'], function () use ($router) {
  49. $router->put('/avatar', 'ProjectController@setAvatar');
  50. $router->delete('/avatar', 'ProjectController@unSetAvatar');
  51. $router->get('/statistics', 'StatisticController@index');
  52. $router->get('/', 'ProjectController@show');
  53. $router->put('/', 'ProjectController@update');
  54. $router->delete('/', 'ProjectController@delete');
  55. $router->group(['prefix' => 'files', 'as' => 'file.', 'middleware' => 'bindBusiness'], function () use ($router) {
  56. // $router->get('/', ['as' => 'index', 'uses' => 'FileController@index']);
  57. $router->post('/', ['as' => 'store', 'uses' => 'FileController@store']);
  58. $router->group(['prefix' => '{file}'], function () use ($router) {
  59. $router->get('/', ['as' => 'download', 'uses' => 'FileController@download']);
  60. $router->put('/', ['as' => 'rename', 'uses' => 'FileController@rename']);
  61. $router->delete('/', ['as' => 'delete', 'uses' => 'FileController@delete']);
  62. });
  63. });
  64. $router->get('/restore', 'ProjectController@restore');
  65. $router->group(['prefix' => 'sprints', 'as' => 'sprint.', 'middleware' => 'bindBusiness'], function () use ($router) {
  66. $router->get('/', ['as' => 'index', 'uses' => 'SprintController@index']);
  67. $router->post('/', ['as' => 'store', 'uses' => 'SprintController@store']);
  68. $router->group(['prefix' => '{sprint}'], function () use ($router) {
  69. $router->get('/', ['as' => 'show', 'uses' => 'SprintController@show']);
  70. $router->put('/', ['as' => 'update', 'uses' => 'SprintController@update']);
  71. $router->delete('/', ['as' => 'delete', 'uses' => 'SprintController@delete']);
  72. });
  73. });
  74. $router->group(['prefix' => 'systems', 'middleware' => 'bindBusiness'], function () use ($router) {
  75. $router->get('/', 'SystemController@index');
  76. $router->post('/', 'SystemController@store');
  77. $router->group(['prefix' => '{system}'], function () use ($router) {
  78. $router->get('/', 'SystemController@show');
  79. $router->put('/', 'SystemController@update');
  80. $router->delete('/', 'SystemController@delete');
  81. });
  82. });
  83. $router->group(['prefix' => 'tasks/{task}/files', 'middleware' => 'bindBusiness'], function () use ($router) {
  84. $router->get('/', ['uses' => 'TaskFileController@index']);
  85. $router->post('/', ['uses' => 'TaskFileController@sync']);
  86. $router->get('/{file}', ['uses' => 'TaskFileController@download']);
  87. });
  88. $router->group(['prefix' => 'users'], function () use ($router){
  89. $router->post('/', 'ProjectController@storeOrUpdateUser');
  90. $router->group(['prefix' => '{user}'], function () use ($router) {
  91. $router->delete('/', 'ProjectController@deleteUser');
  92. });
  93. });
  94. $router->group(['prefix' => 'tasks'], function ($router) {
  95. $router->post('/', 'TaskController@store');
  96. $router->group(['prefix' => '{task}'], function ($router) {
  97. $router->get('/', 'TaskController@show');
  98. $router->put('/', 'TaskController@update');
  99. $router->delete('/', 'TaskController@destroy');
  100. $router->post('/watchers', 'TaskController@toggleWatcher');
  101. $router->group(['prefix' => 'works'], function ($router) {
  102. $router->post('/', 'WorkController@store');
  103. $router->group(['prefix' => '{work}'], function ($router) {
  104. $router->get('/', 'WorkController@show');
  105. $router->put('/', 'WorkController@update');
  106. $router->delete('/', 'WorkController@destroy');
  107. });
  108. });
  109. $router->group(['prefix' => 'comments'], function ($router) {
  110. $router->get('/', 'CommentController@index');
  111. $router->post('/', 'CommentController@store');
  112. $router->group(['prefix' => '{comment}'], function ($router) {
  113. $router->get('/', 'CommentController@show');
  114. $router->put('/', 'CommentController@update');
  115. $router->delete('/', 'CommentController@destroy');
  116. });
  117. });
  118. });
  119. });
  120. });
  121. });
  122. $router->group(['prefix' => 'tags', 'as' => 'tag.', 'middleware' => 'bindBusiness'], function () use ($router) {
  123. $router->get('/', ['as' => 'index', 'uses' => 'TagController@index']);
  124. $router->post('/', ['as' => 'store', 'uses' => 'TagController@store']);
  125. $router->group(['prefix' => '{tag}'], function () use ($router) {
  126. $router->get('/', ['as' => 'show', 'uses' => 'TagController@show']);
  127. $router->put('/', ['as' => 'update', 'uses' => 'TagController@update']);
  128. $router->delete('/', ['as' => 'delete', 'uses' => 'TagController@delete']);
  129. });
  130. });
  131. $router->group(['prefix' => 'workflows', 'as' => 'workflow.', 'middleware' => 'bindBusiness'], function () use ($router) {
  132. $router->get('/', ['as' => 'index', 'uses' => 'WorkflowController@index']);
  133. $router->post('/', ['as' => 'store', 'uses' => 'WorkflowController@store']);
  134. $router->group(['prefix' => '{workflow}'], function () use ($router) {
  135. $router->get('/', ['as' => 'show', 'uses' => 'WorkflowController@show']);
  136. $router->put('/', ['as' => 'update', 'uses' => 'WorkflowController@update']);
  137. $router->delete('/', ['as' => 'delete', 'uses' => 'WorkflowController@delete']);
  138. $router->group(['prefix' => 'statuses', 'middleware' => 'bindBusiness'], function () use ($router) {
  139. $router->get('/', 'StatusController@index');
  140. $router->post('/', 'StatusController@store');
  141. $router->group(['prefix' => '{status}'], function () use ($router) {
  142. $router->get('/', 'StatusController@show');
  143. $router->put('/', 'StatusController@update');
  144. $router->delete('/', ['as' => 'delete', 'uses' => 'StatusController@delete']);
  145. });
  146. });
  147. });
  148. });
  149. $router->group(['prefix' => 'users'], function () use ($router){
  150. $router->post('/', 'BusinessController@storeOrUpdateUser');
  151. $router->group(['prefix' => '{user}'], function () use ($router) {
  152. $router->delete('/', 'BusinessController@deleteUser');
  153. });
  154. });
  155. });
  156. });
  157. $router->group(['prefix' => 'users','middleware' => 'bindBusiness'], function () use ($router) {
  158. $router->get('/', 'UserController@index');
  159. $router->get('/search', 'UserController@search');
  160. $router->group(['prefix' => '{user}'], function () use ($router) {
  161. $router->get('/', 'UserController@show');
  162. $router->put('/', 'UserController@update');
  163. $router->put('/avatar', 'UserController@setAvatar');
  164. $router->delete('/avatar', 'UserController@unSetAvatar');
  165. });
  166. });