Commit ee30cc91 authored by Vishal Vaddadhi's avatar Vishal Vaddadhi

Merge branch 'get' into 'master'

Fixes mapping for get methods

See merge request kmuldoon/student-marks-microservice!6
parents 0314ad4c 9be3127a
...@@ -18,7 +18,7 @@ public class StudentMarksController { ...@@ -18,7 +18,7 @@ public class StudentMarksController {
@Autowired StudentService studentService; @Autowired StudentService studentService;
// (GET) findall studentmarks // (GET) findall studentmarks
@GetMapping @GetMapping("/studentMarks")
ResponseEntity<List<StudentMarks>> findAllStudentMarks(){ ResponseEntity<List<StudentMarks>> findAllStudentMarks(){
return ResponseEntity.ok(studentService.findAllStudents()); return ResponseEntity.ok(studentService.findAllStudents());
} }
...@@ -30,8 +30,8 @@ public class StudentMarksController { ...@@ -30,8 +30,8 @@ public class StudentMarksController {
} }
// (GET) find studentmark by id // (GET) find studentmark by id
@GetMapping @GetMapping("/studentMarks/{id}")
ResponseEntity<StudentMarks> findStudentMarksById(String id){ ResponseEntity<StudentMarks> findStudentMarksById(@PathVariable String id){
StudentMarks sm = studentService.getStudentById(id); StudentMarks sm = studentService.getStudentById(id);
if (sm == null){ if (sm == null){
return new ResponseEntity<>(HttpStatus.NOT_FOUND); return new ResponseEntity<>(HttpStatus.NOT_FOUND);
......
...@@ -20,7 +20,7 @@ public class StudentService { ...@@ -20,7 +20,7 @@ public class StudentService {
public List<StudentMarks> findAllStudents() { public List<StudentMarks> findAllStudents() {
return null; return studentRepository.findAll();
} }
public StudentMarks addStudent(StudentMarks studentMarks) { 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