parent
799af18ef7
commit
d57ed6e020
@ -0,0 +1,17 @@
|
|||||||
|
package SAE.ApiREST.WebService.exception;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
|
@ControllerAdvice
|
||||||
|
public class TeacherAdvice {
|
||||||
|
@ResponseBody
|
||||||
|
@ExceptionHandler(TeacherException.class)
|
||||||
|
@ResponseStatus(HttpStatus.NOT_FOUND)
|
||||||
|
public String teacherNFHandler( TeacherException e) {
|
||||||
|
return e.getMessage();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package SAE.ApiREST.WebService.exception;
|
||||||
|
|
||||||
|
public class TeacherException extends RuntimeException {
|
||||||
|
public TeacherException(String exception) {
|
||||||
|
super(exception);
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,18 @@
|
|||||||
package SAE.ApiREST.WebService.service;
|
package SAE.ApiREST.WebService.service;
|
||||||
|
|
||||||
|
import SAE.ApiREST.WebService.Response;
|
||||||
import SAE.ApiREST.WebService.model.Teacher;
|
import SAE.ApiREST.WebService.model.Teacher;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ITeacherService {
|
public interface ITeacherService {
|
||||||
|
|
||||||
//Todo() by id, by mail, by username, allProf, by date (order), suppression, ajout, FAIRE DES REGIONS!
|
|
||||||
public List<Teacher> getAllTeacher();
|
public List<Teacher> getAllTeacher();
|
||||||
|
public Teacher getTeacherById(Integer id);
|
||||||
Teacher getTeacherById(Integer id);
|
|
||||||
|
|
||||||
public Teacher getTeacherByUsername(String username);
|
public Teacher getTeacherByUsername(String username);
|
||||||
public Teacher getTeacherByMail(String mail);
|
public Teacher getTeacherByMail(String mail);
|
||||||
public Teacher getTeacherByDate(String date);
|
public Teacher getTeacherByDate(String date);
|
||||||
public List<Teacher> addTeacher(Teacher t);
|
public List<Teacher> addTeacher(Teacher t);
|
||||||
|
|
||||||
public List<Teacher> deleteTeacher(Integer id);
|
public List<Teacher> deleteTeacher(Integer id);
|
||||||
|
public Response modifyUsername(Teacher t, String newUsername);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue