using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TaxBaik.Application.Services; namespace TaxBaik.Web.Controllers; [ApiController] [Route("api/[controller]")] [Authorize] public class CommonCodeController(CommonCodeService commonCodeService) : ControllerBase { [HttpGet] public async Task GetAllActive() { try { var codes = await commonCodeService.GetAllActiveAsync(); return Ok(codes); } catch (Exception ex) { return StatusCode(500, new { error = "공통코드 조회 실패", message = ex.Message }); } } [HttpGet("group/{group}")] public async Task GetByGroup(string group) { try { var codes = await commonCodeService.GetByGroupAsync(group); return Ok(codes); } catch (Exception ex) { return StatusCode(500, new { error = "그룹별 공통코드 조회 실패", message = ex.Message }); } } }