fix: Change Code

This commit is contained in:
Suphonchai Phoonsawat 2024-07-06 12:30:37 +07:00
parent 8902080336
commit 89ef146c19
4 changed files with 114 additions and 7 deletions

View file

@ -1,4 +1,5 @@
using System.Text;
using Newtonsoft.Json;
namespace BMA.EHR.Infrastructure.MessageQueue
{
@ -6,6 +7,8 @@ namespace BMA.EHR.Infrastructure.MessageQueue
{
private readonly RabbitMQConnection _connection;
private const string INSIGNIA_QUEUE = "bma_insignia_request";
/// <summary>
///
/// </summary>
@ -36,5 +39,31 @@ namespace BMA.EHR.Infrastructure.MessageQueue
basicProperties: null,
body: body);
}
public void CalculateInsignia(Guid periodId)
{
var channel = _connection.GetChannel();
channel.QueueDeclare(queue: INSIGNIA_QUEUE,
durable: false,
exclusive: false,
autoDelete: false,
arguments: null);
// var req = new InsigniaRequestPeriod
// {
// PeriodId = periodId
// };
// var serializedObject = JsonConvert.SerializeObject(req);
var body = Encoding.UTF8.GetBytes(periodId.ToString("D"));
channel.BasicPublish(exchange: "",
routingKey: INSIGNIA_QUEUE,
mandatory: false,
basicProperties: null,
body: body);
}
}
}