From 9a2e487d8d121db31cc0a15adb7284c44336b7bd Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 28 Jul 2023 10:38:30 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9B=E0=B8=B1?= =?UTF-8?q?=E0=B8=8D=E0=B8=AB=E0=B8=B2=20GlobalExceptionMiddleware=20Restu?= =?UTF-8?q?rn=20Response=20200=20=E0=B9=80=E0=B8=A1=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=A1=E0=B8=A1=E0=B8=B5=20Exception=20500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/PlacementCommandRepository.cs | 7 +++++ .../Controllers/OrderController.cs | 26 +++++++++++++++++++ .../Middlewares/ErrorHandlerMiddleware.cs | 1 + .../Persistence/ApplicationDBContext.cs | 9 +++---- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Commands/PlacementCommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/PlacementCommandRepository.cs index 4ce22254..176f911f 100644 --- a/BMA.EHR.Application/Repositories/Commands/PlacementCommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/PlacementCommandRepository.cs @@ -23,5 +23,12 @@ namespace BMA.EHR.Application.Repositories.Commands } #endregion + + #region " Methods " + + + + #endregion + } } diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs index 901f42cd..f71e64e1 100644 --- a/BMA.EHR.Command.Service/Controllers/OrderController.cs +++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs @@ -280,6 +280,32 @@ namespace BMA.EHR.Command.Service.Controllers } } + /// + /// PM7-26 : ข้อมูลเลือกรายชื่อออกคำสั่ง + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("persons/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + [AllowAnonymous] + public async Task> GetCommandReceiver(Guid orderId) + { + try + { + throw new NotImplementedException(); + } + catch + { + throw; + } + } + + #endregion } } diff --git a/BMA.EHR.Domain/Middlewares/ErrorHandlerMiddleware.cs b/BMA.EHR.Domain/Middlewares/ErrorHandlerMiddleware.cs index 3bc1c9bf..4ef7672f 100644 --- a/BMA.EHR.Domain/Middlewares/ErrorHandlerMiddleware.cs +++ b/BMA.EHR.Domain/Middlewares/ErrorHandlerMiddleware.cs @@ -74,6 +74,7 @@ namespace BMA.EHR.Domain.Middlewares responseModel.Message = GlobalMessages.ForbiddenAccess; break; default: + response.StatusCode = (int)HttpStatusCode.InternalServerError; responseModel.Status = (int)HttpStatusCode.InternalServerError; responseModel.Message = GlobalMessages.ExceptionOccured; break; diff --git a/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs b/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs index deeb0f27..503522e0 100644 --- a/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs @@ -1,17 +1,16 @@ using BMA.EHR.Application.Common.Interfaces; +using BMA.EHR.Domain.Models.Commands.Core; using BMA.EHR.Domain.Models.Documents; using BMA.EHR.Domain.Models.HR; +using BMA.EHR.Domain.Models.Insignias; using BMA.EHR.Domain.Models.MetaData; -using BMA.EHR.Domain.Models.OrganizationEmployee; using BMA.EHR.Domain.Models.Notifications; +using BMA.EHR.Domain.Models.OrganizationEmployee; using BMA.EHR.Domain.Models.Organizations; using BMA.EHR.Domain.Models.Organizations.Report2; using BMA.EHR.Domain.Models.Placement; -using Microsoft.EntityFrameworkCore; -using BMA.EHR.Domain.Models.Commands.Core; -using BMA.EHR.Domain.Models.Commands; -using BMA.EHR.Domain.Models.Insignias; using BMA.EHR.Domain.Models.Retirement; +using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Infrastructure.Persistence {