fix: queue client && inmemory repository
This commit is contained in:
@@ -4,6 +4,7 @@ using InServiceQue.Core.Repositories;
|
||||
using InServiceQue.InMemory;
|
||||
using InServiceQue.Sample;
|
||||
using InServiceQue.Services;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -16,12 +17,18 @@ var app = builder.Build();
|
||||
|
||||
app.MapGet("/", async (string msg) =>
|
||||
{
|
||||
var taskRepository = app.Services.GetService<IQueueClient>();
|
||||
await taskRepository.AddTaskAsync(new QueueTask(new SendMessageTask(new SendMessagePayload()
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
{
|
||||
From = "John", To = "Esther", Message = msg
|
||||
})));
|
||||
await taskRepository.AddTaskAsync(new QueueTask(new OtherMessageTask(msg)));
|
||||
var taskRepository = app.Services.GetService<IQueueClient>();
|
||||
await taskRepository.AddTaskAsync(new SendMessageTask(new SendMessagePayload()
|
||||
{
|
||||
From = "John", To = "Esther", Message = msg
|
||||
}));
|
||||
await taskRepository.AddTaskAsync(new OtherMessageTask(msg));
|
||||
|
||||
return new OkResult();
|
||||
}
|
||||
|
||||
return new OkResult();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user