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.

216 lines
11 KiB

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