Commit ee30cc91 authored by Vishal Vaddadhi's avatar Vishal Vaddadhi

Merge branch 'get' into 'master'

Fixes mapping for get methods

See merge request !6
parents 0314ad4c 9be3127a
......@@ -18,7 +18,7 @@ public class StudentMarksController {
@Autowired StudentService studentService;
// (GET) findall studentmarks
@GetMapping
@GetMapping("/studentMarks")
ResponseEntity<List<StudentMarks>> findAllStudentMarks(){
return ResponseEntity.ok(studentService.findAllStudents());
}
......@@ -30,8 +30,8 @@ public class StudentMarksController {
}
// (GET) find studentmark by id
@GetMapping
ResponseEntity<StudentMarks> findStudentMarksById(String id){
@GetMapping("/studentMarks/{id}")
ResponseEntity<StudentMarks> findStudentMarksById(@PathVariable String id){
StudentMarks sm = studentService.getStudentById(id);
if (sm == null){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
......
......@@ -20,7 +20,7 @@ public class StudentService {
public List<StudentMarks> findAllStudents() {
return null;
return studentRepository.findAll();
}
public StudentMarks addStudent(StudentMarks studentMarks) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment