-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jv-rick-and-morty implementation (fix 5 full fix)
- Loading branch information
1 parent
ff3ac77
commit 933f196
Showing
18 changed files
with
118 additions
and
49 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
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
9 changes: 8 additions & 1 deletion
9
src/main/java/mate/academy/rickandmorty/dto/external/CharacterMetadataDto.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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
package mate.academy.rickandmorty.dto.external; | ||
|
||
public record CharacterMetadataDto(String next) { | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.Objects; | ||
@Getter | ||
@Setter | ||
public class CharacterMetadataDto { | ||
private String next; | ||
} |
15 changes: 11 additions & 4 deletions
15
src/main/java/mate/academy/rickandmorty/dto/external/CharacterResponseDto.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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
package mate.academy.rickandmorty.dto.external; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
public record CharacterResponseDto(@JsonProperty("id") String externalId, | ||
String name, | ||
String status, | ||
String gender) { | ||
import java.util.Objects; | ||
@Getter | ||
@Setter | ||
public final class CharacterResponseDto { | ||
@JsonProperty("id") | ||
private String externalId; | ||
private String name; | ||
private String status; | ||
private String gender; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/mate/academy/rickandmorty/exeption/ConnectionException.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,11 @@ | ||
package mate.academy.rickandmorty.exeption; | ||
|
||
public class ConnectionException extends RuntimeException{ | ||
public ConnectionException(String message) { | ||
super(message); | ||
} | ||
|
||
public ConnectionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/mate/academy/rickandmorty/exeption/ConvertException.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,11 @@ | ||
package mate.academy.rickandmorty.exeption; | ||
|
||
public class ConvertException extends RuntimeException{ | ||
public ConvertException(String message) { | ||
super(message); | ||
} | ||
|
||
public ConvertException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/mate/academy/rickandmorty/external/api/service/CharacterClient.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,7 @@ | ||
package mate.academy.rickandmorty.external.api.service; | ||
|
||
import mate.academy.rickandmorty.dto.external.CharacterFullResponseDto; | ||
|
||
public interface CharacterClient { | ||
CharacterFullResponseDto getDtoFromApi(String url); | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/mate/academy/rickandmorty/external/api/service/DbSynchronizationService.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package mate.academy.rickandmorty.external.api.service; | ||
|
||
public interface DbSynchronizationService { | ||
void synchronize(String url); | ||
void synchronize(); | ||
} |
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
5 changes: 0 additions & 5 deletions
5
src/main/java/mate/academy/rickandmorty/external/api/service/GetClient.java
This file was deleted.
Oops, something went wrong.
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
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