View Javadoc
1   package fr.tiogars.domaintemplate.domains.auth.user.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.domaintemplate.domains.auth.user.entities.User;
9   import fr.tiogars.domaintemplate.domains.auth.user.services.UserService;
10  import io.swagger.v3.oas.annotations.Operation;
11  import io.swagger.v3.oas.annotations.security.SecurityRequirement;
12  import io.swagger.v3.oas.annotations.tags.Tag;
13  
14  /** Exposes the endpoint that lists user accounts. */
15  @Tag(name = "Users", description = "User account management operations.")
16  @RestController
17  public class UsersListController {
18  
19      private final UserService service;
20  
21      UsersListController(UserService service) {
22          this.service = service;
23      }
24  
25      @Operation(summary = "List user accounts")
26      @SecurityRequirement(name = "bearerAuth")
27      @GetMapping("/api/v1/auth/users")
28      List<User> listUsers() {
29          return service.findAll();
30      }
31  }