Xcuello hace 5 años
padre
commit
d4d8607ec2

+ 7
- 7
src/main/java/io/zipcoder/crudapp/Person.java Ver fichero

@@ -12,7 +12,7 @@ public class Person {
12 12
     @GeneratedValue(strategy = GenerationType.AUTO)
13 13
     private String firstName;
14 14
     private String lastName;
15
-    private Integer idNumber;
15
+    private Integer id;
16 16
 
17 17
 
18 18
     public Person() {
@@ -21,7 +21,7 @@ public class Person {
21 21
 
22 22
     public String getFirstName() {
23 23
 
24
-        return firstName;
24
+        return this.firstName;
25 25
     }
26 26
 
27 27
     public void setFirstName(String firstName) {
@@ -31,7 +31,7 @@ public class Person {
31 31
 
32 32
     public String getLastName() {
33 33
 
34
-        return lastName;
34
+        return this.lastName;
35 35
     }
36 36
 
37 37
     public void setLastName(String lastName) {
@@ -39,14 +39,14 @@ public class Person {
39 39
         this.lastName = lastName;
40 40
     }
41 41
 
42
-    public Integer getIdNumber() {
42
+    public Integer getId() {
43 43
 
44
-        return idNumber;
44
+        return this.id;
45 45
     }
46 46
 
47
-    public void setIdNumber(Integer idNumber) {
47
+    public void setId(Integer id) {
48 48
 
49
-        this.idNumber = idNumber;
49
+        this.id = id;
50 50
     }
51 51
 }
52 52
 

+ 2
- 2
src/main/java/io/zipcoder/crudapp/PersonController.java Ver fichero

@@ -42,7 +42,7 @@ public class PersonController {
42 42
     }
43 43
 
44 44
     @RequestMapping(value = "/people/{id}", method = RequestMethod.PUT)
45
-    public ResponseEntity<Person> updatePerson(@PathVariable Integer id,@RequestBody Person updatedPerson) {
45
+    public ResponseEntity<Person> updatePerson(@PathVariable Integer id, @RequestBody Person updatedPerson) {
46 46
 
47 47
         Person p = personRepository.findOne(id);
48 48
 
@@ -51,7 +51,7 @@ public class PersonController {
51 51
             return new ResponseEntity<>(updatedPerson, HttpStatus.OK);
52 52
         }
53 53
 
54
-        updatedPerson.setIdNumber(id);
54
+        updatedPerson.setId(id);
55 55
 
56 56
         personRepository.save(updatedPerson);
57 57