SudoSOS Back-end API / internal/files / SimpleFileController
Class: SimpleFileController ​
This is a mock-controller since there is no actual use for this controller in sudoSOS. This controller allows you to upload files to the server and retrieve them, however in actual production environment we only want to upload files with associations.
For example, the product controller would use the file-service to upload files.
Extends ​
Constructors ​
Constructor ​
new SimpleFileController(options): SimpleFileController;Creates a new product controller instance.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options | BaseControllerOptions | The options passed to the base controller. |
Returns ​
SimpleFileController
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 ​
deleteFile() ​
deleteFile(req, res): Promise<void>;DELETE /files/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
204 - Success
Operation Id ​
deleteFile
Tags ​
files - Operations of the simple files controller
Security ​
JWT
downloadFile() ​
downloadFile(req, res): Promise<void>;GET /files/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The requested file
Operation Id ​
getFile
Tags ​
files - Operations of the simple files controller
Security ​
JWT
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 ​
uploadFile() ​
uploadFile(req, res): Promise<void>;POST /files
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The uploaded file entity
Operation Id ​
createFile
Tags ​
files - Operations of the simple files controller
Consumes ​
multipart/form-data
Security ​
JWT