payloadLifespan/payloadLifetime and other name variants unified to Time To Live naming.
All checks were successful
Build and Push Docker Image / build (push) Successful in 55s
Build and Push Docker Image / docker (push) Successful in 36s

This commit is contained in:
2025-07-05 17:07:53 +02:00
parent 85c462a614
commit a44912ac87
25 changed files with 496 additions and 25 deletions

View File

@ -32,7 +32,7 @@ namespace MessengerApi.Handlers.Endpoint
Guid? toUserId,
string payload,
string payloadType,
int? payloadLifespanInSeconds)
int? timeToLiveInSeconds)
{
// Authorize.
var targetRecipientId = toUserId.HasValue
@ -50,7 +50,7 @@ namespace MessengerApi.Handlers.Endpoint
ToId = targetRecipientId,
Payload = payload,
PayloadType = payloadType,
PayloadLifespanInSeconds = payloadLifespanInSeconds ?? (this.configuration.DefaultMessageLifetimeInMinutes * 60)
TimeToLiveInSeconds = timeToLiveInSeconds ?? (this.configuration.DefaultMessageTimeToLiveInSeconds)
};
this.unitOfWork.Messages.Add(message);

View File

@ -8,6 +8,6 @@
public string PayloadType { get; set; }
public int? PayloadLifetimeInSeconds { get; set; }
public int? TimeToLiveInSeconds { get; set; }
}
}

View File

@ -184,7 +184,7 @@ namespace MessengerApi.Api
{
try
{
var response = await handler.SendMessage(request.ToUserId, request.Payload, request.PayloadType, request.PayloadLifetimeInSeconds);
var response = await handler.SendMessage(request.ToUserId, request.Payload, request.PayloadType, request.TimeToLiveInSeconds);
await unitOfWork.SaveChanges();
return Results.Json(response.Id);
}

View File

@ -10,7 +10,7 @@
"CORS_ORIGINS": "",
"PROXIES": "",
"QUERY_RATE_PER_MINUTE": "100",
"DEFAULT_MESSAGE_LIFETIME_IN_MINUTES": "60",
"DEFAULT_MESSAGE_TIME_TO_LIVE_IN_SECONDS": "60",
"HOUSEKEEPING_ENABLED": "False",
"LOGGING_VERBOSITY": "Trace"
},