WORK-MENTOR / Spring-Rest

0 stars 0 forks source link

Create REST controllers for CRUD opearations #1

Closed MarinTrpenovski closed 1 year ago

MarinTrpenovski commented 1 year ago

For each of the entities create controllers that will return JSON format for GET actions (getById, getAll) For actions save, update , delete just execute the operation return appropriate status code see link for description about http status codes (https://devot.team/blog/http-crud-status-codes-explained) .

Read this link, how to create ResponseEntity with appropriate content to be returned and appropriate status code for each of the actions from CRUD operations (https://www.baeldung.com/spring-response-entity). Each of REST services that you will create should return ResponseEntity object with status code and content.

In this issue just create controllers, no need to integrate service layer and dao layer to get data from Database. Follow UserController pattern. Don't delete UserController class. Pay attention on method names, variable names and don't leave commented code.

You can start work on this.

AngelaM123 commented 1 year ago

I created for each of the entities controllers that will return an JSON format ,I only uploaded the controllers without the model classes and rest of the files because it is that way requested in this issue, also haven't deleted the UserController class and haven't implemented service and DAO layer at this point

MarinTrpenovski commented 1 year ago

Code looks good; Test REST endpoints with Postman in order to be sure that they are working ok.

Model classes must be added , that should not be requested its logically that need to be added. I get errors when pull code from dev. How to test endpoints without defined models that they should return it ? Please add them as soon as possible.

Expected date: 06.02.2023 Monday @AngelaM123 Take a look at this note.

AngelaM123 commented 1 year ago

Model classes are added after checking them let me know for more corrections if needed

MarinTrpenovski commented 1 year ago

image I pull latest changes from dev branch but still errors appear image Model classes I think still missing. Please review @AngelaM123

AngelaM123 commented 1 year ago

I just merged the code and the model classes should be on dev branch

MarinTrpenovski commented 1 year ago

@AngelaM123 Its ok; Closing this issue as resolved.