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