WeddingThankYou 1.0.0.0
결혼식 이후 감사 인사와 사진, 계좌 안내, 연락처를 모바일 페이지로 전달하는 감사장 서비스입니다.
로딩중...
검색중...
일치하는것 없음
WeddingOptions.cs
이 파일의 문서화 페이지로 가기
1using System;
2using System.IO;
3using Microsoft.Extensions.Configuration;
4
6
15public sealed class WeddingOptions
16{
25 public string DataPath { get; set; } = "";
34 public string DefaultSlug { get; set; } = "";
43 public string SuperAdminPassword { get; set; } = "v1.600000.1oy6GjdnZFCRZpxUY6R4tQ==.1r45CdqBw/2U22r0bF9KwzdIfyCVkkRt/VcoAg19LrQ=";
52 public string AtlanAuthKey { get; set; } = "";
61 public string TmapAppKey { get; set; } = "";
62
71 public string ResolvedDataPath
72 {
73 get
74 {
75 if (string.IsNullOrWhiteSpace(DataPath))
76 {
77 var outputDataPath = Path.Combine(AppContext.BaseDirectory, "App_Data", "Wedding");
78 var sourceDataPath = TryFindSourceDataPath();
79 return sourceDataPath ?? outputDataPath;
80 }
81
82 return Path.IsPathRooted(DataPath)
83 ? DataPath
84 : Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, DataPath));
85 }
86 }
87
112 public static WeddingOptions From(IConfiguration configuration)
113 {
114 var opts = new WeddingOptions();
115 configuration.GetSection("Wedding").Bind(opts);
116 return opts;
117 }
118
135 private static string? TryFindSourceDataPath()
136 {
137 var dir = new DirectoryInfo(AppContext.BaseDirectory);
138 while (dir is not null)
139 {
140 var candidate = Path.Combine(dir.FullName, "App_Data", "Wedding");
141 if (Directory.Exists(candidate) && File.Exists(Path.Combine(dir.FullName, "WeddingThankYou.csproj")))
142 {
143 return candidate;
144 }
145
146 dir = dir.Parent;
147 }
148
149 return null;
150 }
151}
static WeddingOptions From(IConfiguration configuration)