Class TestController
- Namespace
- GastroSky.Controllers.V1
- Assembly
- GastroSky.dll
TEST API controller FOR DEBUGGING PURPOSES ONLY! We can get really messy in here without any consequences :) Go ahead; go NUTS! ;DD
[ApiController]
[Authorize(Policy = "ADMIN_ONLY")]
[Route("api/v1/test")]
public class TestController : GastroSkyControllerBase
- Inheritance
-
TestController
- Inherited Members
Constructors
TestController(GastroSkyDatabaseContext, IEmailSenderGastroSky, IEmailTotpService, IRemoteFileStorage, IEmailGenerator)
TEST API controller FOR DEBUGGING PURPOSES ONLY! We can get really messy in here without any consequences :) Go ahead; go NUTS! ;DD
public TestController(GastroSkyDatabaseContext db, IEmailSenderGastroSky emailSender, IEmailTotpService emailTotpService, IRemoteFileStorage remoteFileStorage, IEmailGenerator emailGenerator)
Parameters
dbGastroSkyDatabaseContextemailSenderIEmailSenderGastroSkyemailTotpServiceIEmailTotpServiceremoteFileStorageIRemoteFileStorageemailGeneratorIEmailGenerator
Methods
DeleteTestFileFromRemoteFileStorage(string, Guid)
Deletes a file from the remote file storage location.
[HttpGet]
[Route("delete-test-file-from-remote-file-storage/{containerName}/{fileAccessToken:guid}")]
public Task<IActionResult> DeleteTestFileFromRemoteFileStorage(string containerName, Guid fileAccessToken)
Parameters
containerNamestringAzure Blob Storage container that contains the requested file.
fileAccessTokenGuidFile GUID.
Returns
DownloadTestFileFromRemoteFileStorage(string, Guid)
Downloads a test file that was uploaded using UploadTestFileToRemoteFileStorage(string).
[HttpGet]
[Route("download-test-file-from-remote-file-storage/{containerName}/{fileAccessToken:guid}")]
public Task<IActionResult> DownloadTestFileFromRemoteFileStorage(string containerName, Guid fileAccessToken)
Parameters
containerNamestringAzure Blob Storage container that contains the requested file.
fileAccessTokenGuidFile GUID.
Returns
DownloadTestImageFileFromRemoteFileStorage(string, Guid)
Downloads a test image that was uploaded using UploadTestImageFileToRemoteFileStorage(string, string).
[HttpGet]
[Route("download-test-img-file-from-remote-file-storage/{containerName}/{fileAccessToken:guid}")]
public Task DownloadTestImageFileFromRemoteFileStorage(string containerName, Guid fileAccessToken)
Parameters
containerNamestringAzure Blob Storage container that contains the requested file.
fileAccessTokenGuidFile GUID.
Returns
SendTestEmail(string)
Sends out a test email to check if the IEmailSenderGastroSky implementation functions correctly.
[HttpGet]
[Route("send-test-email")]
public Task<IActionResult> SendTestEmail(string to)
Parameters
tostringRecipient email address.
Returns
SendTestEmail(string, string?, string?)
Sends out a test email of the determined template to check if the IEmailTotpService implementation functions correctly.
[HttpGet]
[Route("send-test-email/{emailId}")]
public Task<IActionResult> SendTestEmail(string emailId, string? to, string? language)
Parameters
emailIdstringEmail template
tostringRecipient email address.
languagestringDesired email language.
Returns
SendTestEmailWithAttachments(string, string, string?, string?)
Sends out a test email with attachments and more parameters to test.
[HttpGet]
[Route("send-test-email-with-attachments")]
public Task<IActionResult> SendTestEmailWithAttachments(string from, string to, string? cc, string? bcc)
Parameters
fromstringSender email address.
tostringRecipient email address.
ccstringCarbon-copy email address.
bccstringBlind-carbon-copy email address.
Returns
SendTestTotp(string, string?)
Sends out a test TOTP verification email to check if the IEmailTotpService implementation functions correctly.
[HttpGet]
[Route("send-test-email-totp")]
public Task<IActionResult> SendTestTotp(string to, string? language)
Parameters
Returns
TestModelBinder(bool?)
Test endpoint for checking if the ASP.NET Core model binder works with certain parameter types.
[HttpGet]
[Route("test-model-binder")]
public IActionResult TestModelBinder(bool? optionalBoolValue = null)
Parameters
optionalBoolValuebool?Does
bool?bind properly? Hm!
Returns
UploadTestFileToRemoteFileStorage(string)
Uploads a test file containing the current UTC date and time as plaintext to the Azure Blob Storage.
[HttpGet]
[Route("upload-test-file-to-remote-file-storage")]
public Task<IActionResult> UploadTestFileToRemoteFileStorage(string containerName = "text-test")
Parameters
containerNamestringAzure Blob Storage destination container name.
Returns
UploadTestImageFileToRemoteFileStorage(string, string)
Uploads a test image to the Azure Blob Storage.
[HttpGet]
[Route("upload-test-img-file-to-remote-file-storage")]
public Task<IActionResult> UploadTestImageFileToRemoteFileStorage(string containerName = "images-test", string localFilePath = "C:\\tmp\\psx.jpg")
Parameters
containerNamestringAzure Blob Storage destination container name.
localFilePathstringThe full path of the file to upload.
Returns
VerifyTestTotp(string, string)
Verifies a TOTP verification mail that was sent out using the /api/v1/test/send-test-email-totp endpoint.
[HttpGet]
[Route("validate-test-email-totp")]
public Task<IActionResult> VerifyTestTotp(string email, string totp)