Package com.omarigrant.budget.services
Class UserService
java.lang.Object
com.omarigrant.budget.services.UserService
A service for handling Users
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindUserFromJwtToken(org.springframework.security.oauth2.jwt.Jwt jwt) Return user from database using JWT token.getAllBudgets(User user) Get all budgets associated with the user.
-
Constructor Details
-
UserService
public UserService()
-
-
Method Details
-
findUserFromJwtToken
Return user from database using JWT token. Checks if user already exists by the oauth sub key, if not creates the user and returns it- Parameters:
jwt- OAuth2 JWT token- Returns:
- User model
-
getAllBudgets
Get all budgets associated with the user.- Parameters:
user- User model- Returns:
- list of BudgetDTO models
-