Package de.terrestris.shoguncore.rest
Class UserRestController<E extends User,D extends UserDao<E>,S extends UserService<E,D>>
- java.lang.Object
-
- de.terrestris.shoguncore.web.AbstractWebController<E,D,S>
-
- de.terrestris.shoguncore.rest.AbstractRestController<E,D,S>
-
- de.terrestris.shoguncore.rest.UserRestController<E,D,S>
-
@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
-
-
Field Summary
-
Fields inherited from class de.terrestris.shoguncore.rest.AbstractRestController
objectMapper
-
Fields inherited from class de.terrestris.shoguncore.web.AbstractWebController
LOG, service
-
-
Constructor Summary
Constructors Modifier Constructor Description UserRestController()Default constructor, which calls the type-constructorprotectedUserRestController(java.lang.Class<E> entityClass)Constructor that sets the concrete entity class for the controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<java.util.Set<UserGroup>>findGroupsOfUser(java.lang.Integer userId)Get the groups of a specific user.voidsetService(S service)We have to useQualifierto define the correct service here.-
Methods inherited from class de.terrestris.shoguncore.rest.AbstractRestController
delete, findAll, findById, findBySimpleFilter, save, update
-
Methods inherited from class de.terrestris.shoguncore.web.AbstractWebController
getEntityClass, getService
-
-
-
-
Constructor Detail
-
UserRestController
public UserRestController()
Default constructor, which calls the type-constructor
-
UserRestController
protected UserRestController(java.lang.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 useQualifierto define the correct service here. Otherwise, spring can not decide which service has to be autowired here as there are multiple candidates.- Specified by:
setServicein classAbstractWebController<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<java.util.Set<UserGroup>> findGroupsOfUser(@PathVariable java.lang.Integer userId)Get the groups of a specific user.- Parameters:
userId-- Returns:
-
-