Class UserRestController<E extends User,​D extends UserDao<E>,​S extends UserService<E,​D>>


  • @RestController
    @RequestMapping("/users")
    public class UserRestController<E extends User,​D extends UserDao<E>,​S extends UserService<E,​D>>
    extends AbstractRestController<E,​D,​S>
    Author:
    Kai Volland, Nils Bühner
    • Constructor Detail

      • UserRestController

        public UserRestController()
        Default constructor, which calls the type-constructor
      • UserRestController

        protected UserRestController​(Class<E> entityClass)
        Constructor that sets the concrete entity class for the controller. Subclasses MUST call this constructor.
    • Method Detail

      • setService

        @Autowired
        @Qualifier("userService")
        public void setService​(S service)
        We have to use Qualifier to define the correct service here. Otherwise, spring can not decide which service has to be autowired here as there are multiple candidates.
        Specified by:
        setService in class AbstractWebController<E extends User,​D extends UserDao<E>,​S extends UserService<E,​D>>
        Parameters:
        service - the service to set
      • findGroupsOfUser

        @RequestMapping(value="/{userId}/userGroups",
                        method=GET)
        public org.springframework.http.ResponseEntity<Set<UserGroup>> findGroupsOfUser​(@PathVariable
                                                                                        Integer userId)
        Get the groups of a specific user.
        Parameters:
        userId -
        Returns: