SudoSOS Back-end API / internal/controllers / RootController
Class: RootController ​
The BaseController class is responsible for:
- Storing route definitions.
- Generating router objects based on the policy.
Extends ​
Constructors ​
Constructor ​
new RootController(options): RootController;Creates a new root controller instance.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options | BaseControllerOptions | The options passed to the base controller. |
Returns ​
RootController
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
roleManager | protected | RoleManager | A reference to the role manager passed in the base controller options. | BaseController.roleManager |
specification | public | SwaggerSpecification | A reference to the swagger specification passed in the base controller options. | BaseController.specification |
Methods ​
getLatestTOS() ​
getLatestTOS(req, res): Promise<void>;GET /terms-of-service/latest
Parameters ​
| Parameter | Type |
|---|---|
req | Request |
res | Response |
Returns ​
Promise<void>
200 - The requested terms of service version
Operation Id ​
getLatestTermsOfService
Tags ​
terms-of-service - Operations of terms of service controller
getPolicy() ​
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.
Overrides ​
getRouter() ​
getRouter(): Router;Returns ​
Router
the router used by this controller.
Inherited from ​
ping() ​
ping(req, res): Promise<void>;GET /ping
Parameters ​
| Parameter | Type |
|---|---|
req | Request |
res | Response |
Returns ​
Promise<void>
200 - Success
Operation Id ​
ping
Tags ​
root - Operations of the root controller
returnAllBanners() ​
returnAllBanners(req, res): Promise<void>;GET /open/banners
Parameters ​
| Parameter | Type |
|---|---|
req | Request |
res | Response |
Returns ​
Promise<void>
200 - All existing banners
Operation Id ​
getAllOpenBanners
Tags ​
banners - Operations of banner controller