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.

209 lines
11 KiB

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