mirror of
https://github.com/PaulReichmuth/timekeep-backend.git
synced 2025-12-22 14:41:57 +00:00
begin documentation of TeamRestController.java
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user