Browse Source

merge task, user routes

pull/2/head
mahdihty 4 years ago
parent
commit
176458893d
  1. 6
      docker-compose.yml
  2. 78
      routes/api.php

6
docker-compose.yml

@ -16,7 +16,7 @@ services:
volumes:
- ./definitions.json:/etc/rabbitmq/definitions.json
depends_on:
- laravel
- laravel.test
minio:
image: minio/minio
command: server /data
@ -28,7 +28,7 @@ services:
networks:
- sail
depends_on:
- laravel
- laravel.test
commander:
image: rediscommander/redis-commander:latest
environment:
@ -54,7 +54,7 @@ services:
- redis-data:/data
networks:
- sail
laravel:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile

78
routes/api.php

@ -12,6 +12,7 @@ $router->group(['prefix' => 'actions'], function () use ($router) {
$router->get('/callback', 'CreditController@callback');
$router->get('/{transaction}/redirection', 'CreditController@redirection');
$router->post('/log', 'ActivityController@store');
$router->group(['prefix' => 'auth'], function () use ($router) {
$router->get('/', 'AuthController@auth');
@ -37,6 +38,9 @@ $router->group(['prefix' => 'businesses'], function () use ($router) {
$router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/tasks', 'TaskController@index');
$router->get('/works', 'WorkController@index');
$router->get('statistics', 'StatisticController@index');
$router->put('/avatar', 'BusinessController@setAvatar');
$router->delete('/avatar', 'BusinessController@unSetAvatar');
@ -61,6 +65,7 @@ $router->group(['prefix' => 'businesses'], function () use ($router) {
$router->put('/avatar', 'ProjectController@setAvatar');
$router->delete('/avatar', 'ProjectController@unSetAvatar');
$router->get('/statistics', 'StatisticController@index');
$router->get('/', 'ProjectController@show');
$router->put('/', 'ProjectController@update');
@ -109,6 +114,37 @@ $router->group(['prefix' => 'businesses'], function () use ($router) {
});
});
$router->group(['prefix' => 'tasks'], function ($router) {
$router->post('/', 'TaskController@store');
$router->group(['prefix' => '{task}'], function ($router) {
$router->get('/', 'TaskController@show');
$router->put('/', 'TaskController@update');
$router->delete('/', 'TaskController@destroy');
$router->post('/watchers', 'TaskController@toggleWatcher');
$router->group(['prefix' => 'works'], function ($router) {
$router->post('/', 'WorkController@store');
$router->group(['prefix' => '{work}'], function ($router) {
$router->get('/', 'WorkController@show');
$router->put('/', 'WorkController@update');
$router->delete('/', 'WorkController@destroy');
});
});
$router->group(['prefix' => 'comments'], function ($router) {
$router->get('/', 'CommentController@index');
$router->post('/', 'CommentController@store');
$router->group(['prefix' => '{comment}'], function ($router) {
$router->get('/', 'CommentController@show');
$router->put('/', 'CommentController@update');
$router->delete('/', 'CommentController@destroy');
});
});
});
});
});
});
@ -161,45 +197,3 @@ $router->group(['prefix' => 'users'], function () use ($router) {
$router->delete('/avatar', 'UserController@unSetAvatar');
});
});
$router->group([], function () use ($router) {
$router->post('/log', 'ActivityController@store');
$router->group(['prefix' => 'businesses/{business}', 'middleware' => ['auth', 'bindBusiness']], function ($router) {
$router->get('/tasks', 'TaskController@index');
$router->get('/works', 'WorkController@index');
$router->get('statistics', 'StatisticController@index');
$router->get('projects/{project}/statistics', 'StatisticController@index');
$router->get('/tasks/{task}', 'TaskController@show');
$router->group(['prefix' => 'projects/{project}/tasks'], function ($router) {
$router->post('/', 'TaskController@store');
$router->group(['prefix' => '{task}'], function ($router) {
$router->get('/', 'TaskController@show');
$router->put('/', 'TaskController@update');
$router->delete('/', 'TaskController@destroy');
$router->post('/watchers', 'TaskController@toggleWatcher');
$router->group(['prefix' => 'works'], function ($router) {
$router->post('/', 'WorkController@store');
$router->group(['prefix' => '{work}'], function ($router) {
$router->get('/', 'WorkController@show');
$router->put('/', 'WorkController@update');
$router->delete('/', 'WorkController@destroy');
});
});
$router->group(['prefix' => 'comments'], function ($router) {
$router->get('/', 'CommentController@index');
$router->post('/', 'CommentController@store');
$router->group(['prefix' => '{comment}'], function ($router) {
$router->get('/', 'CommentController@show');
$router->put('/', 'CommentController@update');
$router->delete('/', 'CommentController@destroy');
});
});
});
});
});
});
Loading…
Cancel
Save