Commit 7b88c4f1 authored by Shanelle Valencia's avatar Shanelle Valencia

Work on update

parent bf9b8aae
package com.StudentServices.MarksService.controller; package com.StudentServices.MarksService.controller;
import com.StudentServices.MarksService.model.StudentMarks;
import com.StudentServices.MarksService.service.StudentService; import com.StudentServices.MarksService.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.config.ConfigDataResourceNotFoundException;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -82,6 +84,18 @@ public class StudentMarksController { ...@@ -82,6 +84,18 @@ public class StudentMarksController {
@GetMapping("/studentmarks/{id}")
public ResponseEntity<StudentMarks> getEmployeeById(@PathVariable(value = "emailAddress") String emailAddressId) throws ResourceNotFoundException {
StudentMarks studentMarks = studentService.
.orElseThrow(() -> new ResourceNotFoundException("Employee by Id Not Found" + employeeId));
return ResponseEntity.ok().body(employee);
}
@PutMapping("/studentmarks/update/{id}")
public ResponseEntity<StudentMarks> updateStudentMarks(@PathVariable = "emailAddress") String emailAddressId) throws ConfigDataResourceNotFoundException {
StudentMarks studentMarks = studentService.
}
......
...@@ -25,12 +25,10 @@ public class StudentService { ...@@ -25,12 +25,10 @@ public class StudentService {
public void addStudent(StudentMarks studentMarks) { public void addStudent(StudentMarks studentMarks) {
} }
public StudentMarks getStudentById(String ID) {
return null;
}
public void updateStudent(StudentMarks studentMarks) {
public void updateStudent(StudentMarks studentMarks, StudentMarks studentMarksDetails) {
studentMarks.setMarks(studentMarksDetails.getMarks());
studentRepository.save(studentMarks);
} }
public void deleteStudent(StudentMarks StudentMarks) { public void deleteStudent(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