Package io.github.sigmacasino.routes
Class Account
java.lang.Object
io.github.sigmacasino.HTTPRoute
io.github.sigmacasino.GetRoute
io.github.sigmacasino.HTMLTemplateRoute
io.github.sigmacasino.routes.Account
- All Implemented Interfaces:
spark.Route
The Account class handles the account route, displaying the user's account information.
-
Field Summary
Fields inherited from class io.github.sigmacasino.HTTPRoute
app, loginRequired, path
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHTMLTemplatePath
(spark.Request request) Returns the path to the HTML template for the account page.Returns a map of notification definitions to be used in the Jinjava HTML template.populateContext
(spark.Request request, spark.Response response) Populates the context for the account page with the user's balance as "balance" and recent transactions, including deposits, withdrawals and game results, as a submap containing operation type, identifier, date and amount.Methods inherited from class io.github.sigmacasino.HTMLTemplateRoute
handleGet
Methods inherited from class io.github.sigmacasino.GetRoute
handle, registerSparkRoute
-
Constructor Details
-
Account
Constructs an Account route with the specified application.- Parameters:
app
- the application instance
-
-
Method Details
-
getHTMLTemplatePath
Returns the path to the HTML template for the account page.- Specified by:
getHTMLTemplatePath
in classHTMLTemplateRoute
- Parameters:
request
- the HTTP request- Returns:
- the path to the HTML template
-
populateContext
public Map<String,Object> populateContext(spark.Request request, spark.Response response) throws SQLException Populates the context for the account page with the user's balance as "balance" and recent transactions, including deposits, withdrawals and game results, as a submap containing operation type, identifier, date and amount.- Overrides:
populateContext
in classHTMLTemplateRoute
- Parameters:
request
- the HTTP requestresponse
- the HTTP response- Returns:
- a map containing the user's balance and transactions
- Throws:
SQLException
- if an SQL error occurs
-
getNotificationDefinitions
Description copied from class:HTMLTemplateRoute
Returns a map of notification definitions to be used in the Jinjava HTML template. Intended to be overridden by subclasses, providing their own definitions based on all redirects which point the user to the route with any error or success tags.- Overrides:
getNotificationDefinitions
in classHTMLTemplateRoute
- Returns:
- the definitions as an URL name-notification message map.
-