SudoSOS Back-end API / internal/controllers / BaseController
Abstract Class: BaseController ​
The BaseController class is responsible for:
- Storing route definitions.
- Generating router objects based on the policy.
Extended by ​
AuthenticationControllerAuthenticationQRControllerAuthenticationSecureControllerBalanceControllerBannerControllerContainerControllerDebtorControllerEventControllerEventShiftControllerInactiveAdministrativeCostControllerInvoiceControllerMemberAuthenticationControllerMemberAuthenticationSecureControllerPayoutRequestControllerPointOfSaleControllerProductCategoryControllerProductControllerRbacControllerRootControllerSellerPayoutControllerServerSettingsControllerSimpleFileControllerStripeControllerStripeWebhookControllerSyncControllerTermsOfServiceControllerTestControllerTransactionControllerTransactionSummaryControllerTransferControllerUserControllerUserNotificationControllerVatGroupControllerVoucherGroupControllerWriteOffControllerGewisAuthenticationController
Constructors ​
Constructor ​
ts
new BaseController(options): BaseController;Creates a new controller instance, and generates the router based on its defined policy.
Parameters ​
| Parameter | Type |
|---|---|
options | BaseControllerOptions |
Returns ​
BaseController
Options ​
- The options from which to extract parameters.
Properties ​
| Property | Modifier | Type | Description |
|---|---|---|---|
roleManager | protected | RoleManager | A reference to the role manager passed in the base controller options. |
specification | public | SwaggerSpecification | A reference to the swagger specification passed in the base controller options. |
Methods ​
getPolicy() ​
ts
abstract getPolicy(): Policy;Gets the policy defined by child classes. This policy includes all routes that the controller accepts, the authorization middleware, and the final handler function for every route.
Returns ​
The policy of this controller.
getRouter() ​
ts
getRouter(): Router;Returns ​
Router
the router used by this controller.