UserService

The UserService class is quite similar to the CategoryService, but the rules are about the User entity, for this entity we do not have anything special. We have the @Service annotation, and we received the UserRepository constructor as well. It is quite simple and easy to understand. We will show the UserService implementation, and it must be like this:

package springfive.cms.domain.service;import java.util.List;import java.util.UUID;import org.springframework.stereotype.Service;import springfive.cms.domain.models.User;import springfive.cms.domain.repository.UserRepository;import springfive.cms.domain.vo.UserRequest;@Servicepublic class UserService {  private final UserRepository userRepository; public UserService(UserRepository ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.