-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from anasabbal/day1
begin carrier service with a lot of extends
- Loading branch information
Showing
36 changed files
with
301 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
carrier-service/src/main/java/com/nas/carrier/command/ApplicationSubmitCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.nas.carrier.command; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ApplicationSubmitCommand { | ||
|
||
private String fullName; | ||
private String email; | ||
} |
14 changes: 14 additions & 0 deletions
14
carrier-service/src/main/java/com/nas/carrier/command/JobCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.nas.carrier.command; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.Set; | ||
|
||
@Getter | ||
@Setter | ||
public class JobCommand { | ||
private String description; | ||
private Set<ApplicationSubmitCommand> applicationSubmitCommands; | ||
} |
39 changes: 39 additions & 0 deletions
39
carrier-service/src/main/java/com/nas/carrier/model/ApplicationSubmit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.nas.carrier.model; | ||
|
||
|
||
import com.nas.carrier.command.ApplicationSubmitCommand; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.ManyToOne; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ApplicationSubmit extends BaseEntity{ | ||
|
||
|
||
@Column(name = "FULL_NAME") | ||
private String fullName; | ||
|
||
@Column(name = "EMAIL") | ||
private String email; | ||
|
||
|
||
@ManyToOne | ||
private Job job; | ||
|
||
|
||
public static ApplicationSubmit create(final ApplicationSubmitCommand applicationSubmitCommand){ | ||
final ApplicationSubmit applicationSubmit = new ApplicationSubmit(); | ||
|
||
applicationSubmit.fullName = applicationSubmitCommand.getFullName(); | ||
applicationSubmit.email = applicationSubmitCommand.getEmail(); | ||
|
||
return applicationSubmit; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
carrier-service/src/main/java/com/nas/carrier/model/BaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.nas.carrier.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.GenericGenerator; | ||
import org.springframework.data.annotation.CreatedBy; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedBy; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Setter | ||
@MappedSuperclass | ||
@EntityListeners(value = AuditingEntityListener.class) | ||
@EqualsAndHashCode(onlyExplicitlyIncluded = true) | ||
public abstract class BaseEntity { | ||
@Id | ||
@GeneratedValue(generator = "uuid2") | ||
@GenericGenerator(name = "uuid2", strategy = "uuid2") | ||
@Column(name = "ID") | ||
@EqualsAndHashCode.Include | ||
protected String id; | ||
|
||
@Version | ||
@Column(name = "VERSION") | ||
private Integer version; | ||
|
||
@CreatedDate | ||
@Column(name = "CREATED_AT", updatable = false) | ||
private LocalDateTime createdAt; | ||
|
||
@CreatedBy | ||
@Column(name = "created_by", updatable = false) | ||
private String createdBy = "NAS SYSTEM"; | ||
|
||
@LastModifiedDate | ||
@Column(name = "UPDATED_AT") | ||
private LocalDateTime updatedAt; | ||
|
||
@LastModifiedBy | ||
@Column(name = "updated_by") | ||
private String updatedBy; | ||
|
||
@Column(name = "DELETED") | ||
protected Boolean deleted = false; | ||
|
||
@Column(name = "ACTIVE") | ||
protected Boolean active = true; | ||
} |
17 changes: 17 additions & 0 deletions
17
carrier-service/src/main/java/com/nas/carrier/model/Carrier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.nas.carrier.model; | ||
|
||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Carrier extends BaseEntity{ | ||
|
||
|
||
|
||
} |
38 changes: 38 additions & 0 deletions
38
carrier-service/src/main/java/com/nas/carrier/model/Job.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.nas.carrier.model; | ||
|
||
|
||
import com.nas.carrier.command.ApplicationSubmitCommand; | ||
import com.nas.carrier.command.JobCommand; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.*; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Job extends BaseEntity{ | ||
|
||
|
||
@Column(name = "DESCRIPTION") | ||
private String description; | ||
|
||
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "job") | ||
public Set<ApplicationSubmit> applicationSubmitSet; | ||
|
||
|
||
public static Job create(final JobCommand jobCommand){ | ||
final Job job = new Job(); | ||
|
||
job.description = jobCommand.getDescription(); | ||
job.applicationSubmitSet = createPayloadForApplicationSubmitted(jobCommand.getApplicationSubmitCommands()); | ||
|
||
return job; | ||
} | ||
public static Set<ApplicationSubmit> createPayloadForApplicationSubmitted(final Set<ApplicationSubmitCommand> applicationSubmitCommands){ | ||
return applicationSubmitCommands.stream().map(ApplicationSubmit::create).collect(Collectors.toSet()); | ||
} | ||
} |
Binary file modified
BIN
+0 Bytes
(100%)
circuit-breaker-example/target/circuit-breaker-example-1.0-SNAPSHOT.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Generated by Maven | ||
#Fri Jan 06 18:50:16 WEST 2023 | ||
#Thu Jan 12 15:26:10 WEST 2023 | ||
groupId=com.nas | ||
artifactId=circuit-breaker-example | ||
version=1.0-SNAPSHOT |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Generated by Maven | ||
#Fri Jan 06 18:50:13 WEST 2023 | ||
#Thu Jan 12 15:26:07 WEST 2023 | ||
groupId=com.nas | ||
artifactId=circuit-breaker | ||
version=1.0-SNAPSHOT |
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
config-server/target/config-server-1.0-SNAPSHOT.jar.original
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Generated by Maven | ||
#Fri Jan 06 18:50:05 WEST 2023 | ||
#Thu Jan 12 15:26:03 WEST 2023 | ||
groupId=com.nas | ||
artifactId=config-server | ||
version=1.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-63 Bytes
(93%)
...ion-service/target/classes/com/nas/driver/location/DriverLocationServiceApplication.class
Binary file not shown.
Binary file modified
BIN
+262 Bytes
(120%)
driver-location-service/target/classes/com/nas/driver/location/config/DriverConfig.class
Binary file not shown.
Binary file modified
BIN
-332 Bytes
(90%)
driver-location-service/target/classes/com/nas/driver/location/model/DriverLocation.class
Binary file not shown.
Binary file modified
BIN
+586 Bytes
(120%)
driver-location-service/target/classes/com/nas/driver/location/model/GeoIp.class
Binary file not shown.
Binary file modified
BIN
+46 Bytes
(100%)
driver-location-service/target/classes/com/nas/driver/location/model/LocationEntity.class
Binary file not shown.
Binary file modified
BIN
-12 Bytes
(98%)
...-service/target/classes/com/nas/driver/location/repository/DriverLocationRepository.class
Binary file not shown.
Binary file modified
BIN
-12 Bytes
(98%)
...-service/target/classes/com/nas/driver/location/repository/LocationEntityRepository.class
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
...location-service/target/classes/com/nas/driver/location/service/LocationServiceImpl.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.