|
@@ -39,6 +39,7 @@ public class PersonController {
|
39
|
39
|
}
|
40
|
40
|
|
41
|
41
|
@RequestMapping(value = "/person", method = RequestMethod.GET)
|
|
42
|
+
|
42
|
43
|
public ResponseEntity<Iterable <PersonService > >getPersonList( ){
|
43
|
44
|
Iterable<PersonService> person = personRepository .findAll();
|
44
|
45
|
|
|
@@ -48,11 +49,11 @@ public class PersonController {
|
48
|
49
|
return new ResponseEntity<>(personIterable , HttpStatus.OK ) ;
|
49
|
50
|
}
|
50
|
51
|
|
51
|
|
-// @RequestMapping(value = "/person/{id}", method = RequestMethod.PUT)
|
52
|
|
-// public ResponseEntity<?> updatePerson(@RequestBody PersonService person,@PathVariable Integer id){
|
53
|
|
-// PersonService p=personRepository.save(person ) ;
|
54
|
|
-// return new ResponseEntity<>(HttpStatus.OK);
|
55
|
|
-// }
|
|
52
|
+ @RequestMapping(value = "/person/{id}", method = RequestMethod.PUT)
|
|
53
|
+ public ResponseEntity<?> updatePerson(@RequestBody PersonService person,@PathVariable Integer id){
|
|
54
|
+ PersonService p=personRepository.save(person ) ;
|
|
55
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
56
|
+ }
|
56
|
57
|
@RequestMapping(value = "/person{id}", method = RequestMethod.DELETE )
|
57
|
58
|
public void deletePerson( @PathVariable Integer id){
|
58
|
59
|
personRepository .delete(id);
|