Browse Source

commit modif

placidenduwayo 2 years ago
parent
commit
1177c4d53d

+ 61
- 2
address-microservice/src/main/java/fr/natan/addressmicroservice/entity/Address.java View File

11
 import javax.persistence.Id;
11
 import javax.persistence.Id;
12
 
12
 
13
 @Entity
13
 @Entity
14
-@Data @AllArgsConstructor @NoArgsConstructor @ToString
15
 public class Address {
14
 public class Address {
16
 
15
 
17
     @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
16
     @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
21
     private String pb;
20
     private String pb;
22
     private String city;
21
     private String city;
23
     private String residenceCountry;
22
     private String residenceCountry;
24
-    private String birthCountry;
23
+
24
+    public Address() {
25
+    }
26
+
27
+    public Address(Long addressID, String numHouse, String streetName,
28
+                   String pb, String city, String residenceCountry) {
29
+        this.addressID = addressID;
30
+        this.numHouse = numHouse;
31
+        this.streetName = streetName;
32
+        this.pb = pb;
33
+        this.city = city;
34
+        this.residenceCountry = residenceCountry;
35
+    }
36
+
37
+    public Long getAddressID() {
38
+        return addressID;
39
+    }
40
+
41
+    public void setAddressID(Long addressID) {
42
+        this.addressID = addressID;
43
+    }
44
+
45
+    public String getNumHouse() {
46
+        return numHouse;
47
+    }
48
+
49
+    public void setNumHouse(String numHouse) {
50
+        this.numHouse = numHouse;
51
+    }
52
+
53
+    public String getStreetName() {
54
+        return streetName;
55
+    }
56
+
57
+    public void setStreetName(String streetName) {
58
+        this.streetName = streetName;
59
+    }
60
+
61
+    public String getPb() {
62
+        return pb;
63
+    }
64
+
65
+    public void setPb(String pb) {
66
+        this.pb = pb;
67
+    }
68
+
69
+    public String getCity() {
70
+        return city;
71
+    }
72
+
73
+    public void setCity(String city) {
74
+        this.city = city;
75
+    }
76
+
77
+    public String getResidenceCountry() {
78
+        return residenceCountry;
79
+    }
80
+
81
+    public void setResidenceCountry(String residenceCountry) {
82
+        this.residenceCountry = residenceCountry;
83
+    }
25
 }
84
 }

+ 0
- 2
address-microservice/src/main/java/fr/natan/addressmicroservice/service/service/AddressService.java View File

25
         address.setPb(address.getPb().strip());
25
         address.setPb(address.getPb().strip());
26
         address.setCity(address.getCity().strip());
26
         address.setCity(address.getCity().strip());
27
         address.setResidenceCountry(address.getResidenceCountry().strip());
27
         address.setResidenceCountry(address.getResidenceCountry().strip());
28
-        address.setBirthCountry(address.getBirthCountry().strip());
29
         return address;
28
         return address;
30
     }
29
     }
31
 
30
 
36
                 || address.getPb().isEmpty()
35
                 || address.getPb().isEmpty()
37
                 || address.getCity().isEmpty()
36
                 || address.getCity().isEmpty()
38
                 || address.getResidenceCountry().isEmpty()
37
                 || address.getResidenceCountry().isEmpty()
39
-                || address.getBirthCountry().isEmpty()
40
         ){
38
         ){
41
             isInvalid=true;
39
             isInvalid=true;
42
         }
40
         }

+ 18
- 5
employee-microservice/src/main/java/fr/natan/employeemicroservice/entity/Employee.java View File

16
     private String lastname;
16
     private String lastname;
17
     private String email;
17
     private String email;
18
     private String createdDate;
18
     private String createdDate;
19
+    private String birthCountry;
19
     private Long addressID;
20
     private Long addressID;
20
     @Transient
21
     @Transient
21
     private Address address;
22
     private Address address;
22
 
23
 
23
-    public Employee(Long employeeID, String firstname, String lastname, String email, String createdDate,
24
-                    Long addressID, Address address) {
24
+    public Employee() {
25
+    }
26
+
27
+    public Employee(Long employeeID,
28
+                    String firstname, String lastname,
29
+                    String email, String createdDate,
30
+                    String birthCountry, Long addressID,
31
+                    Address address) {
25
         this.employeeID = employeeID;
32
         this.employeeID = employeeID;
26
         this.firstname = firstname;
33
         this.firstname = firstname;
27
         this.lastname = lastname;
34
         this.lastname = lastname;
28
         this.email = email;
35
         this.email = email;
29
         this.createdDate = createdDate;
36
         this.createdDate = createdDate;
37
+        this.birthCountry = birthCountry;
30
         this.addressID = addressID;
38
         this.addressID = addressID;
31
         this.address = address;
39
         this.address = address;
32
     }
40
     }
33
 
41
 
34
-    public Employee() {
35
-    }
36
-
37
     public Long getEmployeeID() {
42
     public Long getEmployeeID() {
38
         return employeeID;
43
         return employeeID;
39
     }
44
     }
74
         this.createdDate = createdDate;
79
         this.createdDate = createdDate;
75
     }
80
     }
76
 
81
 
82
+    public String getBirthCountry() {
83
+        return birthCountry;
84
+    }
85
+
86
+    public void setBirthCountry(String birthCountry) {
87
+        this.birthCountry = birthCountry;
88
+    }
89
+
77
     public Long getAddressID() {
90
     public Long getAddressID() {
78
         return addressID;
91
         return addressID;
79
     }
92
     }

+ 1
- 0
employee-microservice/src/main/java/fr/natan/employeemicroservice/service/services/EmployeeService.java View File

29
     private Employee normalizeEmployee(Employee employee){
29
     private Employee normalizeEmployee(Employee employee){
30
         employee.setFirstname(employee.getFirstname().strip());
30
         employee.setFirstname(employee.getFirstname().strip());
31
         employee.setLastname(employee.getLastname().strip());
31
         employee.setLastname(employee.getLastname().strip());
32
+        employee.setBirthCountry(employee.getBirthCountry().strip());
32
         employee.setLastname(employee.getLastname().toUpperCase());
33
         employee.setLastname(employee.getLastname().toUpperCase());
33
 
34
 
34
         return employee;
35
         return employee;

+ 0
- 1
employee-microservice/src/main/java/fr/natan/employeemicroservice/t_openFeign/address/Address.java View File

10
     private int pb;
10
     private int pb;
11
     private String city;
11
     private String city;
12
     private String residenceCountry;
12
     private String residenceCountry;
13
-    private String birthCountry;
14
 }
13
 }

Powered by TurnKey Linux.