From f655f37284565f99e1338bd2173b018722589bdd Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Mon, 25 Mar 2024 18:30:59 +0100 Subject: [PATCH] Ajout exceptions notFound Jeu/Invite --- .../exceptions/notFound/InviteNotFoundException.java | 11 ++++++++++- .../sae/exceptions/notFound/JeuNotFoundException.java | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/InviteNotFoundException.java b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/InviteNotFoundException.java index f2587e1..435be02 100644 --- a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/InviteNotFoundException.java +++ b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/InviteNotFoundException.java @@ -1,2 +1,11 @@ -package fr.iut.sciencequest.sae.exceptions.notFound;public class InviteNotFoundException { +package fr.iut.sciencequest.sae.exceptions.notFound; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(HttpStatus.NOT_FOUND) +public class InviteNotFoundException extends EntityNotFoundException{ + public InviteNotFoundException(String id) { + super("Invite", id); + } } diff --git a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/JeuNotFoundException.java b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/JeuNotFoundException.java index b3d1995..9db3b94 100644 --- a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/JeuNotFoundException.java +++ b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/exceptions/notFound/JeuNotFoundException.java @@ -1,7 +1,7 @@ package fr.iut.sciencequest.sae.exceptions.notFound; -public class DifficulteNotFoundException extends EntityNotFoundException{ - public DifficulteNotFoundException(int id) { - super("Difficulté", id); +public class JeuNotFoundException extends EntityNotFoundException{ + public JeuNotFoundException(int id) { + super("Jeu", id); } }