first barebones project structure

This commit is contained in:
2025-10-01 18:27:57 +02:00
parent 66f9d8e22a
commit 5c588c24ba
13 changed files with 258 additions and 35 deletions

View File

@@ -0,0 +1,34 @@
package de.pnreichmuth.timekeep_backend.controllers;
import de.pnreichmuth.timekeep_backend.entities.Team;
import de.pnreichmuth.timekeep_backend.repositories.TeamRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/teams")
public class TeamRestController {
@Autowired
private TeamRepository teamRepository;
@PostMapping("createTeam")
public Team createTeam(){
Team team = new Team();
teamRepository.save(team);
return team;
}
@GetMapping("all")
public List<Team> findAllTeams(){
return teamRepository.findAll();
}
@DeleteMapping("all")
public void deleteAllTeams(){
teamRepository.deleteAll();
}
}