45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Swashbuckle.AspNetCore.Annotations;
|
|
using SPMS.Application.DTOs.AppConfig;
|
|
using SPMS.Application.Interfaces;
|
|
using SPMS.Domain.Common;
|
|
|
|
namespace SPMS.API.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("v1/in/public")]
|
|
[ApiExplorerSettings(GroupName = "public")]
|
|
public class TermsController : ControllerBase
|
|
{
|
|
private readonly IAppConfigService _appConfigService;
|
|
|
|
public TermsController(IAppConfigService appConfigService)
|
|
{
|
|
_appConfigService = appConfigService;
|
|
}
|
|
|
|
[HttpPost("terms")]
|
|
[SwaggerOperation(Summary = "이용약관", Description = "이용약관 URL을 조회합니다.")]
|
|
public async Task<IActionResult> GetTermsAsync()
|
|
{
|
|
var serviceCode = Request.Headers["X-Service-Code"].FirstOrDefault();
|
|
if (string.IsNullOrWhiteSpace(serviceCode))
|
|
return BadRequest(ApiResponse.Fail(ErrorCodes.BadRequest, "X-Service-Code 헤더가 필요합니다."));
|
|
|
|
var result = await _appConfigService.GetTermsAsync(serviceCode);
|
|
return Ok(ApiResponse<AppConfigResponseDto>.Success(result));
|
|
}
|
|
|
|
[HttpPost("privacy")]
|
|
[SwaggerOperation(Summary = "개인정보처리방침", Description = "개인정보처리방침 URL을 조회합니다.")]
|
|
public async Task<IActionResult> GetPrivacyAsync()
|
|
{
|
|
var serviceCode = Request.Headers["X-Service-Code"].FirstOrDefault();
|
|
if (string.IsNullOrWhiteSpace(serviceCode))
|
|
return BadRequest(ApiResponse.Fail(ErrorCodes.BadRequest, "X-Service-Code 헤더가 필요합니다."));
|
|
|
|
var result = await _appConfigService.GetPrivacyAsync(serviceCode);
|
|
return Ok(ApiResponse<AppConfigResponseDto>.Success(result));
|
|
}
|
|
}
|