22
33import com .example .db_setup .model .Player ;
44import com .example .db_setup .model .dto .gamification .PlayerDTO ;
5- import com .example .db_setup .model .repository .PlayerRepository ;
65import com .example .db_setup .service .PlayerService ;
7- import org .slf4j .Logger ;
8- import org .slf4j .LoggerFactory ;
6+ import io .swagger .v3 .oas .annotations .Operation ;
7+ import io .swagger .v3 .oas .annotations .media .ArraySchema ;
8+ import io .swagger .v3 .oas .annotations .media .Content ;
9+ import io .swagger .v3 .oas .annotations .media .Schema ;
10+ import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
11+ import io .swagger .v3 .oas .annotations .responses .ApiResponses ;
912import org .springframework .http .ResponseEntity ;
1013import org .springframework .web .bind .annotation .*;
1114
@@ -26,6 +29,20 @@ public PlayerController(PlayerService playerService) {
2629 this .playerService = playerService ;
2730 }
2831
32+ @ Operation (
33+ summary = "Get all players" ,
34+ description = "Returns a list of all registered players"
35+ )
36+ @ ApiResponses (value = {
37+ @ ApiResponse (
38+ responseCode = "200" ,
39+ description = "List of player returned successfully or empty if there are no players" ,
40+ content = @ Content (
41+ mediaType = "application/json" ,
42+ array = @ ArraySchema (schema = @ Schema (implementation = PlayerDTO .class ))
43+ )
44+ )
45+ })
2946 @ GetMapping ("/players" )
3047 public ResponseEntity <List <PlayerDTO >> getAllPlayers () {
3148 return ResponseEntity .ok (playerService .getAllPlayers ());
0 commit comments