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;
///////////////////////////////////////////////////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")
public ResponseEntity<@NonNull TeamWSTO> createTeam(@RequestBody Team team){
try {
@@ -36,6 +44,11 @@ public class TeamRestController {
}
///////////////////////////////////////////////////BEGIN GET MAPPINGS///////////////////////////////////////////////////
/**
*
* @return
*/
@GetMapping("all")
public ResponseEntity<@NonNull List<TeamWSTO>> getAllTeams(){
List<Team> teams = teamService.getTeams();
@@ -71,6 +84,8 @@ public class TeamRestController {
}
}
///////////////////////////////////////////////////BEGIN DELETE MAPPINGS///////////////////////////////////////////////////
@DeleteMapping("all")
public ResponseEntity< @NonNull String> deleteAllTeams(){
teamService.deleteAllTeams();