- Service 엔티티에 ApnsAuthType/ApnsCertificate/ApnsCertPassword/ApnsCertExpiresAt 추가 - EF Core Configuration + Migration (AddApnsP12Support) - DTO: AuthType 분기 (p8/p12) 지원, p12 필드 추가 - 서비스 로직: AuthType별 검증/저장/조회 분기, X509CertificateLoader로 만료일 추출 - AuthType 전환 시 이전 타입 필드 null 초기화 - 컨트롤러 Swagger Description 업데이트 Closes #214
54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace SPMS.Application.DTOs.Service;
|
|
|
|
public class RegisterServiceRequestDto
|
|
{
|
|
[Required(ErrorMessage = "서비스명은 필수입니다.")]
|
|
[StringLength(100, MinimumLength = 2, ErrorMessage = "서비스명은 2~100자여야 합니다.")]
|
|
public string ServiceName { get; set; } = string.Empty;
|
|
|
|
[StringLength(500, ErrorMessage = "설명은 500자 이내여야 합니다.")]
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// FCM 자격증명 (선택)
|
|
/// </summary>
|
|
public FcmCredentialDto? Fcm { get; set; }
|
|
|
|
/// <summary>
|
|
/// APNs 자격증명 (선택)
|
|
/// </summary>
|
|
public ApnsCredentialDto? Apns { get; set; }
|
|
}
|
|
|
|
public class FcmCredentialDto
|
|
{
|
|
[Required(ErrorMessage = "Service Account JSON은 필수입니다.")]
|
|
public string ServiceAccountJson { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class ApnsCredentialDto
|
|
{
|
|
[Required(ErrorMessage = "Bundle ID는 필수입니다.")]
|
|
public string BundleId { get; set; } = string.Empty;
|
|
|
|
[Required(ErrorMessage = "인증 타입은 필수입니다.")]
|
|
[RegularExpression("^(p8|p12)$", ErrorMessage = "AuthType은 p8 또는 p12만 가능합니다.")]
|
|
public string AuthType { get; set; } = "p8";
|
|
|
|
// p8 필드
|
|
[StringLength(10, MinimumLength = 10, ErrorMessage = "Key ID는 10자리여야 합니다.")]
|
|
public string? KeyId { get; set; }
|
|
|
|
[StringLength(10, MinimumLength = 10, ErrorMessage = "Team ID는 10자리여야 합니다.")]
|
|
public string? TeamId { get; set; }
|
|
|
|
public string? PrivateKey { get; set; }
|
|
|
|
// p12 필드
|
|
public string? CertificateBase64 { get; set; }
|
|
|
|
public string? CertPassword { get; set; }
|
|
}
|