begin documentation of TeamRestController.java

This commit is contained in:
2025-12-18 15:37:44 +01:00
parent ce85b51af3
commit fc123a6e94

View File

@@ -25,6 +25,14 @@ public class TeamRestController {
private final TeamService teamService; private final TeamService teamService;
///////////////////////////////////////////////////BEGIN POST MAPPINGS///////////////////////////////////////////////////
/**
* Creates a team with the information provided via the /teams/createTeam endpoint
* @param team
* @return a ResponseEntity,
* either containing a TeamWSTO if a team was successfully created or a HttpStatus.CONFLICT if the team already existed beforehand
*/
@PostMapping("createTeam") @PostMapping("createTeam")
public ResponseEntity<@NonNull TeamWSTO> createTeam(@RequestBody Team team){ public ResponseEntity<@NonNull TeamWSTO> createTeam(@RequestBody Team team){
try { try {
@@ -36,6 +44,11 @@ public class TeamRestController {
} }
///////////////////////////////////////////////////BEGIN GET MAPPINGS///////////////////////////////////////////////////
/**
*
* @return
*/
@GetMapping("all") @GetMapping("all")
public ResponseEntity<@NonNull List<TeamWSTO>> getAllTeams(){ public ResponseEntity<@NonNull List<TeamWSTO>> getAllTeams(){
List<Team> teams = teamService.getTeams(); List<Team> teams = teamService.getTeams();
@@ -71,6 +84,8 @@ public class TeamRestController {
} }
} }
///////////////////////////////////////////////////BEGIN DELETE MAPPINGS///////////////////////////////////////////////////
@DeleteMapping("all") @DeleteMapping("all")
public ResponseEntity< @NonNull String> deleteAllTeams(){ public ResponseEntity< @NonNull String> deleteAllTeams(){
teamService.deleteAllTeams(); teamService.deleteAllTeams();