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.

165 lines
8.5 KiB

4 years ago
4 years ago
  1. <?php
  2. /** @var \Laravel\Lumen\Routing\Router $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->group(['prefix' => 'auth'], function () use ($router) {
  11. $router->get('/', 'AuthController@auth');
  12. $router->delete('/', 'AuthController@delete');
  13. $router->get('/info', 'AuthController@authWithInfo');
  14. $router->post('login', 'AuthController@login');
  15. $router->post('logout', 'AuthController@logout');
  16. $router->post('register', 'AuthController@register');
  17. $router->post('revoke/{token}', 'AuthController@revoke');
  18. $router->post('forget-password', 'AuthController@forgetPassword');
  19. $router->post('update-password', 'AuthController@updatePassword');
  20. $router->post('verification', 'AuthController@verification');
  21. $router->get('google/redirect', 'AuthController@redirectToGoogle');
  22. $router->get('google/callback', 'AuthController@handleGoogleCallback');
  23. });
  24. $router->group(['prefix' => 'businesses'], function () use ($router) {
  25. $router->get('/', 'BusinessController@index');
  26. $router->post('/', 'BusinessController@store');
  27. $router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
  28. $router->put('/avatar', 'BusinessController@setAvatar');
  29. $router->delete('/avatar', 'BusinessController@unSetAvatar');
  30. $router->get('/', 'BusinessController@show');
  31. $router->put('/', 'BusinessController@update');
  32. $router->delete('/', 'BusinessController@delete');
  33. $router->get('/restore', 'BusinessController@restore');
  34. $router->get('/files', 'FileController@index');
  35. $router->get('/info', 'BusinessController@info');
  36. $router->get('/invoices', 'InvoiceController@index');
  37. $router->get('/invoices/{date}', 'InvoiceController@show');
  38. $router->get('/pay', 'CreditController@pay');
  39. $router->get('/payments', 'CreditController@payments');
  40. $router->group(['prefix' => 'projects'], function () use ($router) {
  41. $router->get('/', 'ProjectController@index');
  42. $router->post('/', 'ProjectController@store');
  43. $router->group(['prefix' => '{project}'], function () use ($router) {
  44. $router->put('/avatar', 'ProjectController@setAvatar');
  45. $router->delete('/avatar', 'ProjectController@unSetAvatar');
  46. $router->get('/', 'ProjectController@show');
  47. $router->put('/', 'ProjectController@update');
  48. $router->delete('/', 'ProjectController@delete');
  49. $router->group(['prefix' => 'files', 'as' => 'file.', 'middleware' => 'bindBusiness'], function () use ($router) {
  50. // $router->get('/', ['as' => 'index', 'uses' => 'FileController@index']);
  51. $router->post('/', ['as' => 'store', 'uses' => 'FileController@store']);
  52. $router->group(['prefix' => '{file}'], function () use ($router) {
  53. $router->get('/', ['as' => 'download', 'uses' => 'FileController@download']);
  54. $router->put('/', ['as' => 'rename', 'uses' => 'FileController@rename']);
  55. $router->delete('/', ['as' => 'delete', 'uses' => 'FileController@delete']);
  56. });
  57. });
  58. $router->get('/restore', 'ProjectController@restore');
  59. $router->group(['prefix' => 'sprints', 'as' => 'sprint.', 'middleware' => 'bindBusiness'], function () use ($router) {
  60. $router->get('/', ['as' => 'index', 'uses' => 'SprintController@index']);
  61. $router->post('/', ['as' => 'store', 'uses' => 'SprintController@store']);
  62. $router->group(['prefix' => '{sprint}'], function () use ($router) {
  63. $router->get('/', ['as' => 'show', 'uses' => 'SprintController@show']);
  64. $router->put('/', ['as' => 'update', 'uses' => 'SprintController@update']);
  65. $router->delete('/', ['as' => 'delete', 'uses' => 'SprintController@delete']);
  66. });
  67. });
  68. $router->group(['prefix' => 'systems', 'middleware' => 'bindBusiness'], function () use ($router) {
  69. $router->get('/', 'SystemController@index');
  70. $router->post('/', 'SystemController@store');
  71. $router->group(['prefix' => '{system}'], function () use ($router) {
  72. $router->get('/', 'SystemController@show');
  73. $router->put('/', 'SystemController@update');
  74. $router->delete('/', 'SystemController@delete');
  75. });
  76. });
  77. $router->group(['prefix' => 'tasks/{task}/files', 'middleware' => 'bindBusiness'], function () use ($router) {
  78. $router->get('/', ['uses' => 'TaskFileController@index']);
  79. $router->post('/', ['uses' => 'TaskFileController@sync']);
  80. $router->get('/{file}', ['uses' => 'TaskFileController@download']);
  81. });
  82. $router->group(['prefix' => 'users'], function () use ($router){
  83. $router->post('/', 'ProjectController@storeOrUpdateUser');
  84. $router->group(['prefix' => '{user}'], function () use ($router) {
  85. $router->delete('/', 'ProjectController@deleteUser');
  86. });
  87. });
  88. });
  89. });
  90. $router->group(['prefix' => 'tags', 'as' => 'tag.', 'middleware' => 'bindBusiness'], function () use ($router) {
  91. $router->get('/', ['as' => 'index', 'uses' => 'TagController@index']);
  92. $router->post('/', ['as' => 'store', 'uses' => 'TagController@store']);
  93. $router->group(['prefix' => '{tag}'], function () use ($router) {
  94. $router->get('/', ['as' => 'show', 'uses' => 'TagController@show']);
  95. $router->put('/', ['as' => 'update', 'uses' => 'TagController@update']);
  96. $router->delete('/', ['as' => 'delete', 'uses' => 'TagController@delete']);
  97. });
  98. });
  99. $router->group(['prefix' => 'workflows', 'as' => 'workflow.', 'middleware' => 'bindBusiness'], function () use ($router) {
  100. $router->get('/', ['as' => 'index', 'uses' => 'WorkflowController@index']);
  101. $router->post('/', ['as' => 'store', 'uses' => 'WorkflowController@store']);
  102. $router->group(['prefix' => '{workflow}'], function () use ($router) {
  103. $router->get('/', ['as' => 'show', 'uses' => 'WorkflowController@show']);
  104. $router->put('/', ['as' => 'update', 'uses' => 'WorkflowController@update']);
  105. $router->delete('/', ['as' => 'delete', 'uses' => 'WorkflowController@delete']);
  106. $router->group(['prefix' => 'statuses', 'middleware' => 'bindBusiness'], function () use ($router) {
  107. $router->get('/', 'StatusController@index');
  108. $router->post('/', 'StatusController@store');
  109. $router->group(['prefix' => '{status}'], function () use ($router) {
  110. $router->get('/', 'StatusController@show');
  111. $router->put('/', 'StatusController@update');
  112. $router->delete('/', ['as' => 'delete', 'uses' => 'StatusController@delete']);
  113. });
  114. });
  115. });
  116. });
  117. $router->group(['prefix' => 'users'], function () use ($router){
  118. $router->post('/', 'BusinessController@storeOrUpdateUser');
  119. $router->group(['prefix' => '{user}'], function () use ($router) {
  120. $router->delete('/', 'BusinessController@deleteUser');
  121. });
  122. });
  123. });
  124. });
  125. $router->get('/callback', 'CreditController@callback');
  126. $router->get('/{transaction}/redirection', 'CreditController@redirection');
  127. $router->group(['prefix' => 'users'], function () use ($router) {
  128. $router->get('/', 'UserController@index');
  129. $router->get('/search', 'UserController@search');
  130. $router->group(['prefix' => '{user}'], function () use ($router) {
  131. $router->get('/', 'UserController@show');
  132. $router->put('/', 'UserController@update');
  133. $router->put('/avatar', 'UserController@setAvatar');
  134. $router->delete('/avatar', 'UserController@unSetAvatar');
  135. });
  136. });