|
|
|
@ -1,10 +1,17 @@
|
|
|
|
|
package SAE.ApiREST.WebService.controller;
|
|
|
|
|
|
|
|
|
|
import SAE.ApiREST.WebService.model.Teacher;
|
|
|
|
|
import SAE.ApiREST.WebService.service.ITeacherService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.print.attribute.standard.Media;
|
|
|
|
|
import java.awt.*;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("/ProfWebService")
|
|
|
|
|
public class TeacherController {
|
|
|
|
@ -15,4 +22,19 @@ public class TeacherController {
|
|
|
|
|
public TeacherController(ITeacherService iserv) {
|
|
|
|
|
this.iTeacherServ = iserv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/all", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
@ResponseStatus(HttpStatus.OK)
|
|
|
|
|
public List<Teacher> getAllTeacher(){
|
|
|
|
|
return iTeacherServ.getAllTeacher();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
@ResponseStatus(HttpStatus.CREATED)
|
|
|
|
|
public Teacher createTeacher( @RequestBody Teacher teach){
|
|
|
|
|
return teach;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//@GetMapping(value = "/{id}")
|
|
|
|
|
//public
|
|
|
|
|
}
|
|
|
|
|