This commit is contained in:
sysadmin
2025-08-27 22:19:39 +01:00
parent 5c6abe5686
commit bbf5acbb6b
22 changed files with 15571 additions and 6 deletions

View File

@@ -84,4 +84,26 @@ public class MessageService : IMessageService
return false;
}
}
public async Task<List<CustomerMessage>?> GetCustomerMessagesAsync(Guid customerId)
{
try
{
var response = await _httpClient.GetAsync($"api/bot/messages/customer/{customerId}");
if (response.IsSuccessStatusCode)
{
var messages = await response.Content.ReadFromJsonAsync<List<CustomerMessage>>();
return messages ?? new List<CustomerMessage>();
}
_logger.LogWarning("Failed to get customer messages: {StatusCode}", response.StatusCode);
return new List<CustomerMessage>();
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting customer messages");
return new List<CustomerMessage>();
}
}
}