aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/Users/Controllers/UserController.php
diff options
context:
space:
mode:
Diffstat (limited to 'api/Users/Controllers/UserController.php')
-rw-r--r--api/Users/Controllers/UserController.php57
1 files changed, 0 insertions, 57 deletions
diff --git a/api/Users/Controllers/UserController.php b/api/Users/Controllers/UserController.php
deleted file mode 100644
index 5178dcb..0000000
--- a/api/Users/Controllers/UserController.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-namespace Api\Users\Controllers;
-
-use Illuminate\Http\Request;
-use Infrastructure\Http\Controller;
-use Api\Users\Requests\CreateUserRequest;
-use Api\Users\Services\UserService;
-
-class UserController extends Controller
-{
- private $userService;
-
- public function __construct(UserService $userService)
- {
- $this->userService = $userService;
- }
-
- public function getAll()
- {
- $resourceOptions = $this->parseResourceOptions();
-
- $data = $this->userService->getAll($resourceOptions);
- $parsedData = $this->parseData($data, $resourceOptions, 'users');
-
- return $this->response($parsedData);
- }
-
- public function getById($userId)
- {
- $resourceOptions = $this->parseResourceOptions();
-
- $data = $this->userService->getById($userId, $resourceOptions);
- $parsedData = $this->parseData($data, $resourceOptions, 'user');
-
- return $this->response($parsedData);
- }
-
- public function create(CreateUserRequest $request)
- {
- $data = $request->get('user', []);
-
- return $this->response($this->userService->create($data), 201);
- }
-
- public function update($userId, Request $request)
- {
- $data = $request->get('user', []);
-
- return $this->response($this->userService->update($userId, $data));
- }
-
- public function delete($userId)
- {
- return $this->response($this->userService->delete($userId));
- }
-}