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.

215 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->get('google/redirect', 'AuthController@redirectToGoogle')->name('google.redirect');
  29. $router->get('google/callback', 'AuthController@handleGoogleCallback')->name('google.callback');
  30. $router->get('update-fcm', 'AuthController@updateFcmToken')->middleware('auth:api');
  31. });
  32. $router->group(['prefix' => 'businesses', 'middleware' => 'auth:api'], function () use ($router) {
  33. $router->get('/', 'BusinessController@index');
  34. $router->post('/', 'BusinessController@store');
  35. $router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
  36. $router->get('/notifications', 'NotificationController@index');
  37. $router->get('/notifications/{notification}/read', 'NotificationController@markAsRead');
  38. $router->get('/tasks', 'TaskController@index');
  39. $router->get('/works', 'WorkController@index');
  40. $router->get('statistics', 'StatisticController@index');
  41. $router->put('/avatar', 'BusinessController@setAvatar');
  42. $router->delete('/avatar', 'BusinessController@unSetAvatar');
  43. $router->get('/', 'BusinessController@show');
  44. $router->put('/', 'BusinessController@update');
  45. $router->delete('/', 'BusinessController@delete');
  46. $router->get('/restore', 'BusinessController@restore');
  47. $router->get('/files', 'FileController@index');
  48. $router->get('/info', 'BusinessController@info');
  49. $router->get('/invoices', 'InvoiceController@index');
  50. $router->get('/invoices/{date}', 'InvoiceController@show');
  51. $router->get('/pay', 'CreditController@pay');
  52. $router->get('/payments', 'CreditController@payments');
  53. $router->group(['prefix' => 'projects'], function () use ($router) {
  54. $router->get('/', 'ProjectController@index');
  55. $router->post('/', 'ProjectController@store');
  56. $router->group(['prefix' => '{project}'], function () use ($router) {
  57. $router->put('/avatar', 'ProjectController@setAvatar');
  58. $router->delete('/avatar', 'ProjectController@unSetAvatar');
  59. $router->get('/statistics', 'StatisticController@index');
  60. $router->get('/', 'ProjectController@show');
  61. $router->put('/', 'ProjectController@update');
  62. $router->delete('/', 'ProjectController@delete');
  63. $router->group(['prefix' => 'files', 'as' => 'file.', 'middleware' => 'bindBusiness'], function () use ($router) {
  64. // $router->get('/', ['as' => 'index', 'uses' => 'FileController@index']);
  65. $router->post('/', ['as' => 'store', 'uses' => 'FileController@store']);
  66. $router->group(['prefix' => '{file}'], function () use ($router) {
  67. $router->get('/', ['as' => 'download', 'uses' => 'FileController@download']);
  68. $router->put('/', ['as' => 'rename', 'uses' => 'FileController@rename']);
  69. $router->delete('/', ['as' => 'delete', 'uses' => 'FileController@delete']);
  70. });
  71. });
  72. $router->get('/restore', 'ProjectController@restore');
  73. $router->group(['prefix' => 'sprints', 'as' => 'sprint.', 'middleware' => 'bindBusiness'], function () use ($router) {
  74. $router->get('/', ['as' => 'index', 'uses' => 'SprintController@index']);
  75. $router->post('/', ['as' => 'store', 'uses' => 'SprintController@store']);
  76. $router->group(['prefix' => '{sprint}'], function () use ($router) {
  77. $router->get('/', ['as' => 'show', 'uses' => 'SprintController@show']);
  78. $router->put('/', ['as' => 'update', 'uses' => 'SprintController@update']);
  79. $router->delete('/', ['as' => 'delete', 'uses' => 'SprintController@delete']);
  80. });
  81. });
  82. $router->group(['prefix' => 'systems', 'middleware' => 'bindBusiness'], function () use ($router) {
  83. $router->get('/', 'SystemController@index');
  84. $router->post('/', 'SystemController@store');
  85. $router->group(['prefix' => '{system}'], function () use ($router) {
  86. $router->get('/', 'SystemController@show');
  87. $router->put('/', 'SystemController@update');
  88. $router->delete('/', 'SystemController@delete');
  89. });
  90. });
  91. $router->group(['prefix' => 'tasks/{task}/files', 'middleware' => 'bindBusiness'], function () use ($router) {
  92. $router->get('/', ['uses' => 'TaskFileController@index']);
  93. $router->post('/', ['uses' => 'TaskFileController@sync']);
  94. $router->get('/{file}', ['uses' => 'TaskFileController@download']);
  95. });
  96. $router->group(['prefix' => 'users'], function () use ($router){
  97. $router->post('/', 'ProjectController@storeOrUpdateUser');
  98. $router->group(['prefix' => '{user}'], function () use ($router) {
  99. $router->delete('/', 'ProjectController@deleteUser');
  100. });
  101. });
  102. $router->group(['prefix' => 'tasks'], function ($router) {
  103. $router->post('/', 'TaskController@store');
  104. $router->group(['prefix' => '{task}'], function ($router) {
  105. $router->get('/', 'TaskController@show');
  106. $router->put('/', 'TaskController@update');
  107. $router->delete('/', 'TaskController@destroy');
  108. $router->post('/watchers', 'TaskController@toggleWatcher');
  109. $router->group(['prefix' => 'works'], function ($router) {
  110. $router->post('/', 'WorkController@store');
  111. $router->group(['prefix' => '{work}'], function ($router) {
  112. $router->get('/', 'WorkController@show');
  113. $router->put('/', 'WorkController@update');
  114. $router->delete('/', 'WorkController@destroy');
  115. });
  116. });
  117. $router->group(['prefix' => 'comments'], function ($router) {
  118. $router->get('/', 'CommentController@index');
  119. $router->post('/', 'CommentController@store');
  120. $router->group(['prefix' => '{comment}'], function ($router) {
  121. $router->get('/', 'CommentController@show');
  122. $router->put('/', 'CommentController@update');
  123. $router->delete('/', 'CommentController@destroy');
  124. });
  125. });
  126. });
  127. });
  128. });
  129. });
  130. $router->group(['prefix' => 'tags', 'as' => 'tag.', 'middleware' => 'bindBusiness'], function () use ($router) {
  131. $router->get('/', ['as' => 'index', 'uses' => 'TagController@index']);
  132. $router->post('/', ['as' => 'store', 'uses' => 'TagController@store']);
  133. $router->group(['prefix' => '{tag}'], function () use ($router) {
  134. $router->get('/', ['as' => 'show', 'uses' => 'TagController@show']);
  135. $router->put('/', ['as' => 'update', 'uses' => 'TagController@update']);
  136. $router->delete('/', ['as' => 'delete', 'uses' => 'TagController@delete']);
  137. });
  138. });
  139. $router->group(['prefix' => 'workflows', 'as' => 'workflow.', 'middleware' => 'bindBusiness'], function () use ($router) {
  140. $router->get('/', ['as' => 'index', 'uses' => 'WorkflowController@index']);
  141. $router->post('/', ['as' => 'store', 'uses' => 'WorkflowController@store']);
  142. $router->group(['prefix' => '{workflow}'], function () use ($router) {
  143. $router->get('/', ['as' => 'show', 'uses' => 'WorkflowController@show']);
  144. $router->put('/', ['as' => 'update', 'uses' => 'WorkflowController@update']);
  145. $router->delete('/', ['as' => 'delete', 'uses' => 'WorkflowController@delete']);
  146. $router->group(['prefix' => 'statuses', 'middleware' => 'bindBusiness'], function () use ($router) {
  147. $router->get('/', 'StatusController@index');
  148. $router->post('/', 'StatusController@store');
  149. $router->group(['prefix' => '{status}'], function () use ($router) {
  150. $router->get('/', 'StatusController@show');
  151. $router->put('/', 'StatusController@update');
  152. $router->delete('/', ['as' => 'delete', 'uses' => 'StatusController@delete']);
  153. });
  154. });
  155. });
  156. });
  157. $router->group(['prefix' => 'users'], function () use ($router){
  158. $router->post('/', 'BusinessController@storeOrUpdateUser');
  159. $router->group(['prefix' => '{user}'], function () use ($router) {
  160. $router->delete('/', 'BusinessController@deleteUser');
  161. });
  162. });
  163. $router->group(['prefix' => 'activities'], function () use ($router) {
  164. $router->post('/', 'ActivityController@store');
  165. $router->get('/', 'ActivityController@index');
  166. });
  167. });
  168. });
  169. $router->group(['prefix' => 'users','middleware' => 'bindBusiness'], function () use ($router) {
  170. $router->get('/', 'UserController@index');
  171. $router->get('/search', 'UserController@search');
  172. $router->group(['prefix' => '{user}'], function () use ($router) {
  173. $router->get('/', 'UserController@show');
  174. $router->put('/', 'UserController@update');
  175. $router->put('/avatar', 'UserController@setAvatar');
  176. $router->delete('/avatar', 'UserController@unSetAvatar');
  177. });
  178. });