개선: 배포 검증과 관리자 UX 안정화
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using TaxBaik.Domain.Entities;
|
||||
using TaxBaik.Domain.Interfaces;
|
||||
|
||||
namespace TaxBaik.Application.Services;
|
||||
|
||||
public class SiteSettingService(ISiteSettingRepository repository)
|
||||
{
|
||||
public Task<IReadOnlyDictionary<string, string>> GetAllAsync(CancellationToken ct = default)
|
||||
=> repository.GetAllAsync(ct);
|
||||
|
||||
public Task SaveAsync(string phone, string email, string kakaoUrl, string instagramUrl, CancellationToken ct = default)
|
||||
{
|
||||
var settings = new[]
|
||||
{
|
||||
new SiteSetting { Key = "PhoneNumber", Value = phone.Trim(), UpdatedAt = DateTime.UtcNow },
|
||||
new SiteSetting { Key = "EmailAddress", Value = email.Trim(), UpdatedAt = DateTime.UtcNow },
|
||||
new SiteSetting { Key = "KakaoChannelUrl", Value = kakaoUrl.Trim(), UpdatedAt = DateTime.UtcNow },
|
||||
new SiteSetting { Key = "InstagramUrl", Value = instagramUrl.Trim(), UpdatedAt = DateTime.UtcNow },
|
||||
};
|
||||
|
||||
return repository.UpsertAsync(settings, ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user