[Feature]: Spieler bannen #15
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TowerDefence/Server#15
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "TD-4_Admin_kann_spieler_bannen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket
TD-4
Beschreibung
Der Player Modell wurde um die Funktionalität erweitert, einen Spieler zu bannen und zu entbannen.
Weitere Infos
No response
Test sind durch gefallen. Guckt euch das nochmal an
Bitte zu /player/login 403 hinzufügen für, wenn jemand gebannt ist
@ -259,6 +265,40 @@ paths:
type: array
items:
$ref: "#/components/schemas/AdministratablePlayer"
ihr habt beim /admin/players endpunkt kein 401, 500 und 503 mehr. sind benötigt
@ -262,0 +279,4 @@
- admin
summary: "Ban player by id"
description: "Bans a player by id, making them unable to play the game."
responses:
404 wenn spieler nicht gefunden
@ -262,0 +281,4 @@
description: "Bans a player by id, making them unable to play the game."
responses:
200:
description: "Successfully banned player!"
401,500 & 503 fehlen
@ -262,0 +296,4 @@
- admin
summary: "Unban player by id"
description: "Unbans a player by id, allowing them to play the game."
responses:
404 hinzufügen, fals der speiler nicht gefunden wird
@ -60,0 +64,4 @@
@Override
public ResponseEntity<Void> banPlayer(Long id) {
this.playerService.banPlayer(id);
return null;
ist null hier richtig? wollen wir nicht ein 200 zurückgeben?
@ -86,0 +97,4 @@
@Override
public ResponseEntity<Void> unbanPlayer(Long id) {
this.playerService.unbanPlayer(id);
return null;
st null hier richtig? wollen wir nicht ein 200 zurückgeben?
@ -50,2 +51,4 @@
return md.digest(password);
}
public void banPlayer(Long id) {
Wenn der Spieler nicht existiert, sollte diese Funktion einen PlayerNotFound Exception schmeißen
@ -52,0 +58,4 @@
});
}
public void unbanPlayer(Long id) {
Wenn der Spieler nicht existiert, sollte diese Funktion einen PlayerNotFound Exception schmeißen
@ -45,7 +45,7 @@ public class ServerApiController implements ServerApi {
@Override
public ResponseEntity<Void> playerRegister(PlayerRegistrationData body) {
if(playerRepository.existsByUsername(body.getUsername())){
return new ResponseEntity<>(HttpStatus.CONFLICT);
warum die änderung?
@ -63,1 +63,4 @@
Player player = playerRepository.findByUsername(body.getUsername());
if(player.isBanned())
{
return new ResponseEntity<>(HttpStatus.CONFLICT);
403 währe hier richtig.
403 ist für wenn man sich authentiziert hat, aber keine zugriffsrechte hat
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.