feat(EnvelopeLocked): Timer mit CSS-Konfiguration und Javascript-Ereignis hinzugefügt.

- Ablauf über Home-Controller-Ansichtsdaten hinzugefügt
This commit is contained in:
Developer 02
2024-11-30 01:56:02 +01:00
parent cdec5485c6
commit fa44b82493
12 changed files with 99 additions and 14 deletions

View File

@@ -2,6 +2,6 @@
{
public class CodeGeneratorConfig
{
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
}
}

View File

@@ -4,6 +4,8 @@
{
public required bool Ok { get; init; }
public DateTime? Expiration { get; set; }
public DateTime? AllowedAt { get; set; }
public TimeSpan AllowedAfter => Allowed ? TimeSpan.Zero : AllowedAt!.Value - DateTime.Now;

View File

@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services
public static CodeGenerator Static => LazyStatic.Value;
private readonly string _charPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private readonly string _charPool;
public CodeGenerator(IOptions<CodeGeneratorConfig> options)
{

View File

@@ -61,10 +61,13 @@ namespace EnvelopeGenerator.Application.Services
code = _codeGen.GenerateCode(_smsParams.CodeLength);
await _cache.SetStringAsync(code_key, code, _codeCacheOptions);
var expiration = DateTime.Now + _smsParams.CodeCacheValidityPeriod;
await _cache.SetDateTimeAsync(code_expiration_key, expiration, _codeCacheOptions);
await _cache.SetDateTimeAsync(code_expiration_key, DateTime.Now + _smsParams.CodeCacheValidityPeriod, _codeCacheOptions);
return await SendSmsAsync(recipient: recipient, message: code);
var res = await SendSmsAsync(recipient: recipient, message: code);
res.Expiration = expiration;
return res;
}
else
{