Package de.terrestris.shoguncore.web
Class UserController<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.web.UserController<E,D,S>
-
@Controller @RequestMapping("/user") public class UserController<E extends User,D extends UserDao<E>,S extends UserService<E,D>> extends AbstractWebController<E,D,S>- Author:
- Daniel Koch
-
-
Field Summary
-
Fields inherited from class de.terrestris.shoguncore.web.AbstractWebController
logger, service
-
-
Constructor Summary
Constructors Modifier Constructor Description UserController()Default constructor, which calls the type-constructorprotectedUserController(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 java.util.Map<java.lang.String,java.lang.Object>activateUser(java.lang.String token)java.util.Map<java.lang.String,java.lang.Object>changePassword(java.lang.String password, java.lang.String token)PasswordResetTokenService<PasswordResetToken,PasswordResetTokenDao<PasswordResetToken>>getPasswordResetTokenService()java.util.Map<java.lang.String,java.lang.Object>getUserBySession()java.util.Map<java.lang.String,java.lang.Object>registerUser(javax.servlet.http.HttpServletRequest request, java.lang.String email, java.lang.String password)java.util.Map<java.lang.String,java.lang.Object>resetPassword(javax.servlet.http.HttpServletRequest request, java.lang.String email)voidsetPasswordResetTokenService(PasswordResetTokenService<PasswordResetToken,PasswordResetTokenDao<PasswordResetToken>> passwordResetTokenService)voidsetService(S service)We have to useQualifierto define the correct service here.-
Methods inherited from class de.terrestris.shoguncore.web.AbstractWebController
getEntityClass, getService
-
-
-
-
Constructor Detail
-
UserController
public UserController()
Default constructor, which calls the type-constructor
-
UserController
protected UserController(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
-
registerUser
@RequestMapping(value="/register.action", method=POST, produces="application/json;charset=UTF-8") @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> registerUser(javax.servlet.http.HttpServletRequest request, @RequestParam java.lang.String email, @RequestParam java.lang.String password)- Parameters:
email-password-
-
activateUser
@RequestMapping(value="/activate.action", method=GET, produces="application/json;charset=UTF-8") @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> activateUser(@RequestParam java.lang.String token)- Parameters:
token-
-
resetPassword
@RequestMapping(value="/resetPassword.action", method=POST, produces="application/json;charset=UTF-8") @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> resetPassword(javax.servlet.http.HttpServletRequest request, @RequestParam("email") java.lang.String email)- Parameters:
email-
-
changePassword
@RequestMapping(value="/changePassword.action", method=POST, produces="application/json;charset=UTF-8") @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> changePassword(@RequestParam("password") java.lang.String password, @RequestParam("token") java.lang.String token)- Parameters:
token-
-
getUserBySession
@RequestMapping(value="/getUserBySession.action", method=GET, produces="application/json;charset=UTF-8") @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> getUserBySession()
-
getPasswordResetTokenService
public PasswordResetTokenService<PasswordResetToken,PasswordResetTokenDao<PasswordResetToken>> getPasswordResetTokenService()
- Returns:
- the passwordResetTokenService
-
setPasswordResetTokenService
public void setPasswordResetTokenService(PasswordResetTokenService<PasswordResetToken,PasswordResetTokenDao<PasswordResetToken>> passwordResetTokenService)
- Parameters:
passwordResetTokenService- the passwordResetTokenService to set
-
-