diff --git a/app/library/App/Resources/UserResource.php b/app/library/App/Resources/UserResource.php index 7e6f2fd..f0c799d 100755 --- a/app/library/App/Resources/UserResource.php +++ b/app/library/App/Resources/UserResource.php @@ -22,27 +22,26 @@ class UserResource extends ApiResource { ->itemKey('user') ->collectionKey('users') ->deny(AclRoles::UNAUTHORIZED, AclRoles::USER) - ->handler(UserController::class); + ->handler(UserController::class) - $this - ->endpoint(ApiEndpoint::all() - ->allow(AclRoles::USER) - ->name('all') - ->description('Возвращает всех зарегистрированных пользователей') - ); + /** -------------------- [GET] users -------------------------------- **/ + ->endpoint(ApiEndpoint::all() + ->allow(AclRoles::USER) + ->name('all') + ->description('Возвращает всех зарегистрированных пользователей') + ) + /** ----------------------------------------------------------------- **/ - $this - ->endpoint(ApiEndpoint::remove() - ->name('remove') - ->description('Удаление пользователя') + /** -------------------- [GET] users/me ----------------------------- **/ + ->endpoint(ApiEndpoint::factory('/me', HttpMethods::GET, 'meAction') + ->name('me') + ->description('Возвращает текущего залогиненного пользователя') ->allow(AclRoles::USER) - ->exampleResponse([ - "result" => "OK" - ]) ) - ; - $this - ->endpoint(ApiEndpoint::update() + /** ----------------------------------------------------------------- **/ + + /** -------------------- [PUT] users/{id} -------------------------- **/ + ->endpoint(ApiEndpoint::update() ->name('update') ->description('Изменение данных пользователя') ->allow(AclRoles::ADMINISTRATOR) @@ -62,17 +61,21 @@ class UserResource extends ApiResource { ] ]) ) - ; + /** ----------------------------------------------------------------- **/ - $this - ->endpoint(ApiEndpoint::factory('/me', HttpMethods::GET, 'meAction') - ->name('me') - ->description('Возвращает текущего залогиненного пользователя') + /** -------------------- [DELETE] users/{id} ------------------------ **/ + ->endpoint(ApiEndpoint::remove() + ->name('remove') + ->description('Удаление пользователя') ->allow(AclRoles::USER) - ); + ->exampleResponse([ + "result" => "OK" + ]) + ) + /** ----------------------------------------------------------------- **/ - $this - ->endpoint(ApiEndpoint::factory('/authenticate', HttpMethods::POST, 'authenticateAction') + /** -------------------- [POST] users/authenticate ------------------ **/ + ->endpoint(ApiEndpoint::factory('/authenticate', HttpMethods::POST, 'authenticateAction') ->name('authenticate') ->description('Авторизация пользователя через BasicAuth и возвращает токен доступа') ->allow(AclRoles::UNAUTHORIZED) @@ -93,9 +96,11 @@ class UserResource extends ApiResource { ] ]) - ); - $this - ->endpoint(ApiEndpoint::factory('/', HttpMethods::POST, 'registerAction') + ) + /** ----------------------------------------------------------------- **/ + + /** -------------------- [POST] users -------------------------------- **/ + ->endpoint(ApiEndpoint::factory('/', HttpMethods::POST, 'registerAction') ->name('register') ->description('Регистрация нового пользователя') ->allow(AclRoles::UNAUTHORIZED) @@ -111,6 +116,8 @@ class UserResource extends ApiResource { "updatedAt" => "2017-02-16 17:57:52" ] ]) - ); + ) + /** ----------------------------------------------------------------- **/ + ; } } \ No newline at end of file -- libgit2 0.21.4