WORK-MENTOR / Spring-Rest

0 stars 0 forks source link

Connect layers in project #3

Closed MarinTrpenovski closed 1 year ago

MarinTrpenovski commented 1 year ago

Integrate service layer in REST controllers. Now each of the endpoints should return data from Database.

When link service layer methods use @autowire anotation to use service's classes in controllers.

REST endpoints should return ResponseEntity object with appropriate status codes for each of the CRUD operations. (https://www.baeldung.com/spring-response-entity)

You can start work on this issue

AngelaM123 commented 1 year ago

have manage to connect layer in the project and commit the newest versions of the controllers after checking let me know for more corrections if something is missing

MarinTrpenovski commented 1 year ago

Just remove this code I think its not needed to have init() method. I was just for testing purposes before connect to Database. Now when you are connected to Database you can remove method and all logic related with manipulation with that Array. @AngelaM123 Please take a look at this issue. image image

If you want to keep it, in case to remember it you can leave it in one of the Entities, but remove logic from REST endpoint when invoke them.

AngelaM123 commented 1 year ago

I have edited the controller classes I have deleted the init() method and other codes related to that logic

MarinTrpenovski commented 1 year ago

Code looks good @AngelaM123 closing this issue.