Merge branch 'develop' into work

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2023-09-05 19:45:32 +07:00
commit e7c71b2e15
6 changed files with 1063 additions and 20 deletions

View file

@ -1,4 +1,5 @@
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Messaging;
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Repositories.Commands;
using BMA.EHR.Application.Repositories.MessageQueue;
using BMA.EHR.Application.Repositories.Reports;
@ -28,6 +29,8 @@ namespace BMA.EHR.Application
services.AddTransient<InsigniaReportRepository>();
services.AddTransient<CommandReportRepository>();
services.AddTransient<EmailSenderService>();
return services;
}
}

View file

@ -3,7 +3,7 @@ using Microsoft.Extensions.Configuration;
using System.Net;
using System.Net.Mail;
namespace BMA.EHR.Infrastructure.Messaging
namespace BMA.EHR.Application.Messaging
{
public class EmailSenderService
{

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Messaging;
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Repositories.Commands;
using BMA.EHR.Application.Requests.Commands;
using BMA.EHR.Application.Responses;
@ -12,7 +13,6 @@ using BMA.EHR.Infrastructure.Persistence;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System.Net;
using System.Net.Http.Headers;
using System.Security.Claims;
@ -37,6 +37,7 @@ namespace BMA.EHR.Command.Service.Controllers
private readonly CommandTypeRepository _commandTypeRepository;
private readonly CommandStatusRepository _commandStatusRepository;
private readonly UserProfileRepository _userProfileRepository;
private readonly EmailSenderService _emailSenderService;
#endregion
@ -50,7 +51,8 @@ namespace BMA.EHR.Command.Service.Controllers
PrefixRepository prefixRepository,
CommandTypeRepository commandTypeRepository,
CommandStatusRepository commandStatusRepository,
UserProfileRepository userProfileRepository)
UserProfileRepository userProfileRepository,
EmailSenderService emailSenderService)
{
_repository = repository;
_context = context;
@ -61,6 +63,7 @@ namespace BMA.EHR.Command.Service.Controllers
_commandTypeRepository = commandTypeRepository;
_commandStatusRepository = commandStatusRepository;
_userProfileRepository = userProfileRepository;
_emailSenderService = emailSenderService;
}
#endregion
@ -88,6 +91,22 @@ namespace BMA.EHR.Command.Service.Controllers
#region " Methods "
//[HttpGet("mail")]
//[AllowAnonymous]
//public IActionResult TestSendMail()
//{
// try
// {
// _emailSenderService.SendMail("test send mail", "test body", "suphonchai@frappet.com");
// return Ok();
// }
// catch
// {
// throw;
// }
//}
/// <summary>
/// แสดงปีเป็นปีพุทธศักราช โดยดึงจากข้อมูลที่มีในระบบ
/// </summary>

View file

@ -34,5 +34,12 @@
"Protocol": "HTTPS",
"Node": {
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
},
"Mail": {
"Server": "smtp.gmail.com",
"User": "suphonchai.ph@gmail.com",
"Password": "nnjazjcnwhepkxdm",
"MailFrom": "suphonchai.ph@gmail.com",
"Port": "587"
}
}

View file

@ -1,6 +1,5 @@
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories;
using BMA.EHR.Infrastructure.Messaging;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@ -14,7 +13,7 @@ namespace BMA.EHR.Infrastructure
IConfiguration configuration)
{
services.AddTransient<MinIOService>();
services.AddTransient<EmailSenderService>();
var connectionString = configuration.GetConnectionString("DefaultConnection");