- Configure Spring MVC and DB(in
db.properties
file) - Create UserResponseDto
- Implement UserController
- implement method
GET: /users/inject
which will create test data. For example, you can create 3 or 4 users in this method and save them to DB. - method
UserResponseDto get(Long userId)
, URL:GET: /users/{userId}
. This method should return information about user by user id. - method
List<UserResponseDto> getAll
, URL:GET: /users/
. This method should return information about all users from DB.
- implement method
- Create a
UserMapper
inservice
package, where we're gonna perform all mapping to/from DTOs in order to stick with SRP. Use will use this mapper on the controller layer.
You can check yourself using this checklist