44import hexlet .code .dto .task .TaskDTO ;
55import hexlet .code .dto .task .TaskParamsDTO ;
66import hexlet .code .dto .task .TaskUpdateDTO ;
7- import hexlet .code .service .TaskService ;
7+ import hexlet .code .service .TaskServiceImpl ;
88import hexlet .code .specification .TaskSpecification ;
99import jakarta .validation .Valid ;
1010import lombok .AllArgsConstructor ;
2727@ AllArgsConstructor
2828public class TaskController {
2929
30- private final TaskService taskService ;
30+ private final TaskServiceImpl taskServiceImpl ;
3131 private final TaskSpecification specBuilder ;
3232
3333 /**
@@ -36,7 +36,7 @@ public class TaskController {
3636 */
3737 @ GetMapping (path = "" )
3838 public ResponseEntity <List <TaskDTO >> index (TaskParamsDTO dto ) {
39- var result = taskService .getAll (dto );
39+ var result = taskServiceImpl .getAll (dto );
4040 return ResponseEntity .ok ().header ("X-Total-Count" , String .valueOf (result .size ())).body (result );
4141 }
4242
@@ -47,7 +47,7 @@ public ResponseEntity<List<TaskDTO>> index(TaskParamsDTO dto) {
4747 @ GetMapping (path = "/{id}" )
4848 @ ResponseStatus (HttpStatus .OK )
4949 public TaskDTO show (@ PathVariable long id ) {
50- return taskService .getById (id );
50+ return taskServiceImpl .getById (id );
5151 }
5252
5353 /**
@@ -57,7 +57,7 @@ public TaskDTO show(@PathVariable long id) {
5757 @ PostMapping (path = "" )
5858 @ ResponseStatus (HttpStatus .CREATED )
5959 public TaskDTO create (@ Valid @ RequestBody TaskCreateDTO dto ) {
60- return taskService .create (dto );
60+ return taskServiceImpl .create (dto );
6161 }
6262
6363 /**
@@ -68,7 +68,7 @@ public TaskDTO create(@Valid @RequestBody TaskCreateDTO dto) {
6868 @ PutMapping (path = "/{id}" )
6969 @ ResponseStatus (HttpStatus .OK )
7070 public TaskDTO update (@ PathVariable ("id" ) Long id , @ Valid @ RequestBody TaskUpdateDTO dto ) {
71- return taskService .update (id , dto );
71+ return taskServiceImpl .update (id , dto );
7272 }
7373
7474 /**
@@ -77,6 +77,6 @@ public TaskDTO update(@PathVariable("id") Long id, @Valid @RequestBody TaskUpdat
7777 @ DeleteMapping (path = "/{id}" )
7878 @ ResponseStatus (HttpStatus .NO_CONTENT )
7979 public void delete (@ PathVariable long id ) {
80- taskService .delete (id );
80+ taskServiceImpl .delete (id );
8181 }
8282}
0 commit comments