cc72a67355
- 연간 세무 캘린더(7개 시즌) 기반 자동 Hero 섹션 전환 - 시즌 감지 시 D-Day 카운트다운, 긴박감 배지, 시즌 CTA 표시 - 서비스 카드 순서 시즌 관련 항목 우선 정렬 - 어드민 공지사항 CRUD (등록·수정·삭제, 기간·유형 설정) - 홈페이지 상단 공지 배너 자동 노출 (일반/배너/긴급) - CLAUDE.md에 세무 캘린더 및 마케팅 방향 하네스 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
namespace TaxBaik.Application.Services;
|
|
|
|
using TaxBaik.Application.DTOs;
|
|
using TaxBaik.Domain.Entities;
|
|
using TaxBaik.Domain.Interfaces;
|
|
|
|
public class AnnouncementService(IAnnouncementRepository repository)
|
|
{
|
|
public Task<IEnumerable<Announcement>> GetActiveAsync(CancellationToken ct = default)
|
|
=> repository.GetActiveAsync(ct);
|
|
|
|
public Task<IEnumerable<Announcement>> GetAllAsync(CancellationToken ct = default)
|
|
=> repository.GetAllAsync(ct);
|
|
|
|
public Task<Announcement?> GetByIdAsync(int id, CancellationToken ct = default)
|
|
=> repository.GetByIdAsync(id, ct);
|
|
|
|
public Task<int> CreateAsync(AnnouncementDto dto, CancellationToken ct = default)
|
|
{
|
|
var entity = MapToEntity(dto);
|
|
return repository.CreateAsync(entity, ct);
|
|
}
|
|
|
|
public Task UpdateAsync(AnnouncementDto dto, CancellationToken ct = default)
|
|
{
|
|
var entity = MapToEntity(dto);
|
|
return repository.UpdateAsync(entity, ct);
|
|
}
|
|
|
|
public Task DeleteAsync(int id, CancellationToken ct = default)
|
|
=> repository.DeleteAsync(id, ct);
|
|
|
|
private static Announcement MapToEntity(AnnouncementDto dto) => new()
|
|
{
|
|
Id = dto.Id,
|
|
Title = dto.Title.Trim(),
|
|
Content = string.IsNullOrWhiteSpace(dto.Content) ? null : dto.Content.Trim(),
|
|
DisplayType = dto.DisplayType,
|
|
IsActive = dto.IsActive,
|
|
StartsAt = dto.StartsAt,
|
|
EndsAt = dto.EndsAt,
|
|
SortOrder = dto.SortOrder
|
|
};
|
|
}
|