using BMA.EHR.Domain.Common; using BMA.EHR.MetaData.Service.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; namespace BMA.EHR.MetaData.Service.Controllers { [Route("api/v{version:apiVersion}/metadata/position-executive-side")] [ApiVersion("1.0")] [ApiController] [Produces("application/json")] [Authorize] [SwaggerTag("จัดการข้อมูลด้านการบริหาร เพื่อนำไปใช้งานในระบบ")] public class PositionExecutiveSideController : BaseController { #region " Fields " private readonly PositionExecutiveSideService _positionExecutiveSideService; #endregion #region " Constructor and Destructor " public PositionExecutiveSideController(PositionExecutiveSideService positionExecutiveSideService) { _positionExecutiveSideService = positionExecutiveSideService; } #endregion #region " Methods " /// /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น /// /// /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsync() { try { var items = await _positionExecutiveSideService.GetsAsync(showAll: false); return Success(items); } catch (Exception ex) { return Error(ex); } } #endregion } }