Refactor ReceiverSignature to method in CacheController
Updated `ReceiverSignature` usage in `CacheController` to reflect its refactoring from a property to a method. This change was applied consistently across the `SaveSignature`, `GetSignature`, and `DeleteSignature` methods, ensuring the `cacheKey` variable now uses `User.ReceiverSignature()` instead of `User.ReceiverSignature`. This refactor likely accommodates additional logic in the `ReceiverSignature` method.
This commit is contained in:
@@ -31,7 +31,7 @@ public class CacheController(
|
|||||||
[FromBody] SignatureCacheRequest request,
|
[FromBody] SignatureCacheRequest request,
|
||||||
CancellationToken cancel)
|
CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature}";
|
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
|
||||||
var json = JsonSerializer.Serialize(request);
|
var json = JsonSerializer.Serialize(request);
|
||||||
|
|
||||||
var options = cacheOptions.Value.SignatureCacheExpiration.HasValue
|
var options = cacheOptions.Value.SignatureCacheExpiration.HasValue
|
||||||
@@ -50,7 +50,7 @@ public class CacheController(
|
|||||||
[HttpGet("SignatureCapture/{envelopeKey}")]
|
[HttpGet("SignatureCapture/{envelopeKey}")]
|
||||||
public async Task<IActionResult> GetSignature([FromRoute] string envelopeKey, CancellationToken cancel)
|
public async Task<IActionResult> GetSignature([FromRoute] string envelopeKey, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature}";
|
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
|
||||||
var json = await cache.GetStringAsync(cacheKey, cancel);
|
var json = await cache.GetStringAsync(cacheKey, cancel);
|
||||||
|
|
||||||
if (json is null)
|
if (json is null)
|
||||||
@@ -67,7 +67,7 @@ public class CacheController(
|
|||||||
[HttpDelete("SignatureCapture/{envelopeKey}")]
|
[HttpDelete("SignatureCapture/{envelopeKey}")]
|
||||||
public async Task<IActionResult> DeleteSignature([FromRoute] string envelopeKey, CancellationToken cancel)
|
public async Task<IActionResult> DeleteSignature([FromRoute] string envelopeKey, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature}";
|
var cacheKey = $"{SignatureCacheKeyPrefix}{User.ReceiverSignature()}";
|
||||||
await cache.RemoveAsync(cacheKey, cancel);
|
await cache.RemoveAsync(cacheKey, cancel);
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
|
|||||||
Reference in New Issue
Block a user