SPMS_API/SPMS.Domain/Entities/Service.cs
SEAN d051ff3b97 improvement: APNs p12 인증서 지원 추가 (#214)
- Service 엔티티에 ApnsAuthType/ApnsCertificate/ApnsCertPassword/ApnsCertExpiresAt 추가
- EF Core Configuration + Migration (AddApnsP12Support)
- DTO: AuthType 분기 (p8/p12) 지원, p12 필드 추가
- 서비스 로직: AuthType별 검증/저장/조회 분기, X509CertificateLoader로 만료일 추출
- AuthType 전환 시 이전 타입 필드 null 초기화
- 컨트롤러 Swagger Description 업데이트

Closes #214
2026-02-25 13:01:55 +09:00

39 lines
1.7 KiB
C#

using SPMS.Domain.Enums;
namespace SPMS.Domain.Entities;
public class Service : BaseEntity
{
public string ServiceCode { get; set; } = string.Empty;
public string ServiceName { get; set; } = string.Empty;
public string? Description { get; set; }
public string ApiKey { get; set; } = string.Empty;
public DateTime ApiKeyCreatedAt { get; set; }
public string? ApnsBundleId { get; set; }
public string? ApnsKeyId { get; set; }
public string? ApnsTeamId { get; set; }
public string? ApnsPrivateKey { get; set; }
public string? ApnsAuthType { get; set; } // "p8" or "p12"
public string? ApnsCertificate { get; set; } // p12 Base64 (암호화 저장)
public string? ApnsCertPassword { get; set; } // p12 비밀번호 (암호화 저장)
public DateTime? ApnsCertExpiresAt { get; set; } // p12 인증서 만료일
public string? FcmCredentials { get; set; }
public string? WebhookUrl { get; set; }
public string? WebhookEvents { get; set; }
public string? Tags { get; set; }
public SubTier SubTier { get; set; }
public DateTime? SubStartedAt { get; set; }
public ServiceStatus Status { get; set; }
public DateTime CreatedAt { get; set; }
public long CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedAt { get; set; }
// Navigation
public Admin CreatedByAdmin { get; set; } = null!;
public ICollection<ServiceIp> ServiceIps { get; set; } = new List<ServiceIp>();
public ICollection<Device> Devices { get; set; } = new List<Device>();
public ICollection<Message> Messages { get; set; } = new List<Message>();
}