Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Oleksii-Melashchenko
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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"

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) {

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.

Comment on lines +19 to +21
default Long setExternalId(CharacterExternalDto characterExternalDto) {
return characterExternalDto.getId();
}

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);

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) {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants