payloadLifespan/payloadLifetime and other name variants unified to Time To Live naming.
This commit is contained in:
@ -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);
|
||||
|
||||
@ -8,6 +8,6 @@
|
||||
|
||||
public string PayloadType { get; set; }
|
||||
|
||||
public int? PayloadLifetimeInSeconds { get; set; }
|
||||
public int? TimeToLiveInSeconds { get; set; }
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user