-
Notifications
You must be signed in to change notification settings - Fork 256
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
added solution #207
base: main
Are you sure you want to change the base?
added solution #207
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.
Great job on implementing the core functionalities and meeting the task requirements! 🎉 While there are a few minor improvements suggested, such as removing unnecessary Pageable
parameters and addressing a placeholder in the MapperConfig
, these do not critically impact the functionality. Keep up the good work and consider these suggestions for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
componentModel = "spring", | ||
injectionStrategy = InjectionStrategy.CONSTRUCTOR, | ||
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, | ||
implementationPackage = "<PACKAGE_NAME>.impl" |
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.
The implementationPackage
attribute contains a placeholder <PACKAGE_NAME>
. You should replace it with the actual package name where the mapper implementations should be generated.
|
||
@Operation(summary = "Fetch a random character") | ||
@GetMapping() | ||
public CharacterDto getRandomCharacter(@ParameterObject @PageableDefault Pageable pageable) { |
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.
The getRandomCharacter
method uses Pageable
, but since it returns a single random character, pagination is not needed here. Consider removing the Pageable
parameter to simplify the method.
default Long setExternalId(CharacterExternalDto characterExternalDto) { | ||
return characterExternalDto.getId(); | ||
} |
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.
The setExternalId
method appears to be redundant because the externalId
is already being set in the toEntity
method using a mapping expression. Consider removing this method if it's not used elsewhere.
|
||
public interface CharacterService { | ||
|
||
CharacterDto getCharacter(Pageable pageable); |
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.
The getCharacter
method includes a Pageable
parameter, which may not be necessary if the method is intended to return a single character. Consider revising the method signature if pagination is not required.
private final CharacterMapper characterMapper; | ||
|
||
@Override | ||
public CharacterDto getCharacter(Pageable pageable) { |
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.
The Pageable
parameter in the getCharacter
method is not used. Since the method returns a single random character, consider removing this parameter to simplify the method signature.
No description provided.