-
Notifications
You must be signed in to change notification settings - Fork 295
finished task #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finished task #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's improve your solution :)
.gitignore
Outdated
src/main/resources/application.properties | ||
src/main/resources/liqubase.properties | ||
test/resources/application.properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you add these files to gitignore?
[2024/07/02 23:35:23.941, java.exe (PID: 12988, TID: 13520), JavaEnvironment.cpp:502 (JavaEnvironment::detect)] | ||
TRACE: Entering JavaEnvironment::detect | ||
[2024/07/02 23:35:23.952, java.exe (PID: 12988, TID: 13520), JavaEnvironment.cpp:519 (JavaEnvironment::detect)] | ||
TRACE: Installed Java detected: version=; arch=64; productCode={701CE19D-1741-5258-9CD3-D5DDD1A6DEDE}; type=1 | ||
[2024/07/02 23:35:23.952, java.exe (PID: 12988, TID: 13520), JavaEnvironment.cpp:135 (`anonymous-namespace'::detectHomeDir)] | ||
TRACE: Find home dir of {701CE19D-1741-5258-9CD3-D5DDD1A6DEDE} Java installation | ||
[2024/07/02 23:35:23.954, java.exe (PID: 12988, TID: 13520), JavaEnvironment.cpp:302 (`anonymous-namespace'::detectFullVersion)] | ||
TRACE: Detect full version of {701CE19D-1741-5258-9CD3-D5DDD1A6DEDE} Java installation | ||
[2024/07/02 23:35:23.955, java.exe (PID: 12988, TID: 13520), JavaEnvironment.cpp:213 (`anonymous-namespace'::detectFullVersionFromMsi)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove mvm/appdata/local/temp files from git
@Component | ||
@AllArgsConstructor | ||
public class CharactersClientImpl implements CharactersClient { | ||
private static final String BASE_URL = "https://rickandmortyapi.com/api"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this url to the config files (application.properties) instead of hardcoding it
.map(charactersMapper::toDto) | ||
.toList(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return charactersRepository.findAllByName(name).stream() | ||
.map(charactersMapper::toDto) | ||
.toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI mapstruct suppports mapping of list to list, you just need to declare it
@Override | ||
public CharactersResponseDto getRandomCharacter() { | ||
Random random = new Random(); | ||
Long randomId = random.nextLong( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make random a class field to avoid recreation per each method invocation
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use Lombok's Data on JPA Entity
No description provided.