Package com.plannaplan.controllers
Class TokenBasedController
java.lang.Object
com.plannaplan.controllers.TokenBasedController
- Direct Known Subclasses:
AssignmentsController
,CommisionController
,ExchangeController
public abstract class TokenBasedController
extends java.lang.Object
Abstract class for controllers that requires token to extra authorize action
beyond spring security
-
Field Summary
Fields Modifier and Type Field Description protected com.plannaplan.services.UserService
userService
-
Constructor Summary
Constructors Constructor Description TokenBasedController()
-
Method Summary
Modifier and Type Method Description protected java.util.Optional<com.plannaplan.entities.User>
getCurrentUser()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
userService
@Autowired protected com.plannaplan.services.UserService userService
-
-
Constructor Details
-
TokenBasedController
public TokenBasedController()
-
-
Method Details
-
getCurrentUser
protected java.util.Optional<com.plannaplan.entities.User> getCurrentUser() throws com.plannaplan.exceptions.UserNotFoundException- Returns:
- get currect user based no current spring context
- Throws:
com.plannaplan.exceptions.UserNotFoundException
- if user was not fount
-