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 ServiceArea service #25

Merged
merged 2 commits into from
Dec 14, 2024
Merged

Added ServiceArea service #25

merged 2 commits into from
Dec 14, 2024

Conversation

vinrran
Copy link
Contributor

@vinrran vinrran commented Dec 11, 2024

Issue #18

private final ServiceAreaService serviceAreaService;

@Autowired
public ServiceAreaController(ServiceAreaService serviceAreaService) { //stack overflow the dependency injection paste error and then @autowire
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the stack overflow comment


@GetMapping
public ResponseEntity<List<ServiceAreaDTO>> getAllServiceAreas() {
List<ServiceAreaDTO> serviceAreaDTOs = this.serviceAreaService.getAllServiceAreas();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use this when calling the serviceAreaService as you already set the attribute in the Constructor of the class. Please change it to serviceAreaService instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for every other usage of serviceAreaService

@miguel-merlin
Copy link
Member

@vinrran I tested in my local and the service started successfully. Left some small nits in the pr. Nice job overall. Please make sure you understand every line of code you wrote. This will be helpful for future implementations.

Just for my edification, can you explain how did you solve the @Autowired error you were seeing?

@vinrran
Copy link
Contributor Author

vinrran commented Dec 12, 2024

@miguel-merlin I'm not entirely sure, but most likely the error was resolved after I completed the ServiceAreaServiceImpl.java file.

Screenshot 2024-12-12 at 11 48 04 AM

This is a screenshot after I comment out everything in the ServiceAreaServiceImpl.java file.

@miguel-merlin
Copy link
Member

@vinrran Thanks for the clarification!

Copy link
Member

@miguel-merlin miguel-merlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! NIce job!

@miguel-merlin miguel-merlin merged commit 0c5c01f into main Dec 14, 2024
2 checks passed
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