1 package fr.tiogars.chat.domains.task.controllers;
2
3 import java.util.List;
4
5 import org.springframework.web.bind.annotation.GetMapping;
6 import org.springframework.web.bind.annotation.RestController;
7
8 import fr.tiogars.chat.domains.task.models.Task;
9 import fr.tiogars.chat.domains.task.services.TaskFindAllService;
10 import io.swagger.v3.oas.annotations.Operation;
11 import io.swagger.v3.oas.annotations.responses.ApiResponse;
12 import io.swagger.v3.oas.annotations.responses.ApiResponses;
13 import io.swagger.v3.oas.annotations.tags.Tag;
14
15
16
17
18
19
20 @Tag(name = "Tasks", description = "CRUD operations for the Task business object.")
21 @RestController
22 public class TasksListController {
23
24 private final TaskFindAllService service;
25
26
27
28
29
30
31 public TasksListController(TaskFindAllService service) {
32 this.service = service;
33 }
34
35
36
37
38
39
40 @Operation(summary = "List tasks", description = "Returns active tasks ordered by immutable code.")
41 @ApiResponses(value = {
42 @ApiResponse(responseCode = "200", description = "Records in the domain were returned.")
43 })
44 @GetMapping("/api/v1/task")
45 public List<Task> listTask() {
46 return service.findAll();
47 }
48 }