Response.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. using Microsoft.AspNetCore.Http;
  2. using System.ComponentModel;
  3. namespace Application.Features.Config.Get;
  4. public sealed class Response
  5. {
  6. public int ID { get; init; }
  7. public BasicConfigDto Basic { get; init; } = new();
  8. public ImagesConfigDto Images { get; init; } = new();
  9. public MetaConfigDto Meta { get; init; } = new();
  10. public CompanyConfigDto Company { get; init; } = new();
  11. public AccountConfigDto Account { get; init; } = new();
  12. public EmailTemplateConfigDto EmailTemplate { get; init; } = new();
  13. public ExternalApiConfigDto External { get; init; } = new();
  14. public TossConfigDto Toss { get; init; } = new();
  15. public AttendanceConfigDto Attendance { get; init; } = new();
  16. public SignupRewardConfigDto SignupReward { get; init; } = new();
  17. public RewardConfigDto Reward { get; init; } = new();
  18. public PaperConfigDto Paper { get; init; } = new();
  19. public DataCollectionConfigDto DataCollection { get; init; } = new();
  20. public sealed class BasicConfigDto
  21. {
  22. [DisplayName("사이트 이름")]
  23. public string? SiteName { get; init; }
  24. [DisplayName("사이트 주소")]
  25. public string? SiteURL { get; init; }
  26. [DisplayName("최고 관리자 ID")]
  27. public string? RootID { get; init; }
  28. [DisplayName("송수신 이메일")]
  29. public string? FromEmail { get; init; }
  30. [DisplayName("송수신자 이름")]
  31. public string? FromName { get; init; }
  32. [DisplayName("SMTP Server")]
  33. public string? SmtpServer { get; init; }
  34. [DisplayName("SMTP Port")]
  35. public int? SmtpPort { get; set; }
  36. [DisplayName("SMTP Enable SSL")]
  37. public bool SmtpEnableSSL { get; init; } = false;
  38. [DisplayName("SMTP Username")]
  39. public string? SmtpUsername { get; init; }
  40. [DisplayName("SMTP Password")]
  41. public string? SmtpPassword { get; init; }
  42. [DisplayName("관리자단 접근 가능 IP")]
  43. public string? AdminWhiteIPList { get; init; }
  44. [DisplayName("사용자단 접근 가능 IP")]
  45. public string? FrontWhiteIPList { get; init; }
  46. [DisplayName("차단 시 안내문 제목")]
  47. public string? BlockAlertTitle { get; init; }
  48. [DisplayName("차단 시 안내문 내용")]
  49. public string? BlockAlertContent { get; init; }
  50. [DisplayName("점검 여부")]
  51. public bool IsMaintenance { get; init; } = false;
  52. [DisplayName("점검 내용")]
  53. public string? MaintenanceContent { get; init; }
  54. [DisplayName("쪽지 일일 발송 제한")]
  55. public int NoteDailySendLimit { get; init; } = 3;
  56. }
  57. public sealed class ImagesConfigDto
  58. {
  59. // ====== DB의 저장/표시용 경로(문자열) ======
  60. [DisplayName("Favicon")]
  61. public string? FaviconPath { get; init; }
  62. [DisplayName("Logo-square")]
  63. public string? LogoSquarePath { get; init; }
  64. [DisplayName("Logo-horizontal")]
  65. public string? LogoHorizontalPath { get; init; }
  66. [DisplayName("og-default")]
  67. public string? OgDefaultPath { get; init; }
  68. [DisplayName("Twitter-image")]
  69. public string? TwitterImagePath { get; init; }
  70. [DisplayName("Apple-touch-icon")]
  71. public string? AppleTouchIconPath { get; init; }
  72. [DisplayName("App-icon-192")]
  73. public string? AppIcon192Path { get; init; }
  74. [DisplayName("App-icon-512")]
  75. public string? AppIcon512Path { get; init; }
  76. // ====== 파일업로드 입력(새 업로드용) ======
  77. [DisplayName("Favicon 업로드")]
  78. public IFormFile? FaviconFile { get; init; }
  79. [DisplayName("Logo-square 업로드")]
  80. public IFormFile? LogoSquareFile { get; init; }
  81. [DisplayName("Logo-horizontal 업로드")]
  82. public IFormFile? LogoHorizontalFile { get; init; }
  83. [DisplayName("og-default 업로드")]
  84. public IFormFile? OgDefaultFile { get; init; }
  85. [DisplayName("Twitter-image 업로드")]
  86. public IFormFile? TwitterImageFile { get; init; }
  87. [DisplayName("Apple-touch-icon 업로드")]
  88. public IFormFile? AppleTouchIconFile { get; init; }
  89. [DisplayName("App-icon-192 업로드")]
  90. public IFormFile? AppIcon192File { get; init; }
  91. [DisplayName("App-icon-512 업로드")]
  92. public IFormFile? AppIcon512File { get; init; }
  93. }
  94. public sealed class MetaConfigDto
  95. {
  96. [DisplayName("Meta Keywords")]
  97. public string? Keywords { get; init; }
  98. [DisplayName("Meta Description")]
  99. public string? Description { get; init; }
  100. [DisplayName("Meta Author")]
  101. public string? Author { get; init; }
  102. [DisplayName("Meta Viewport")]
  103. public string? Viewport { get; init; }
  104. [DisplayName("Meta ApplicationName")]
  105. public string? ApplicationName { get; init; }
  106. [DisplayName("Meta Generator")]
  107. public string? Generator { get; init; }
  108. [DisplayName("Meta Robots")]
  109. public string? Robots { get; init; }
  110. [DisplayName("Meta Adds")]
  111. public string? Adds { get; init; }
  112. }
  113. public sealed class CompanyConfigDto
  114. {
  115. [DisplayName("상호 명")]
  116. public string? Name { get; init; }
  117. [DisplayName("사업자 등록 번호")]
  118. public string? RegNo { get; init; }
  119. [DisplayName("사업장 소재지")]
  120. public string? Address { get; init; }
  121. [DisplayName("우편번호")]
  122. public string? ZipCode { get; init; }
  123. [DisplayName("대표자 명")]
  124. public string? Owner { get; init; }
  125. [DisplayName("대표 전화번호")]
  126. public string? Tel { get; init; }
  127. [DisplayName("FAX")]
  128. public string? Fax { get; init; }
  129. [DisplayName("통신판매업 신고번호")]
  130. public string? RetailSaleNo { get; init; }
  131. [DisplayName("부가통신 사업자번호")]
  132. public string? AddedSaleNo { get; init; }
  133. [DisplayName("호스팅 서비스")]
  134. public string? Hosting { get; init; }
  135. [DisplayName("정보관리책임자")]
  136. public string? AdminName { get; init; }
  137. [DisplayName("정보관리책임자 이메일")]
  138. public string? AdminEmail { get; init; }
  139. [DisplayName("사이트 주소")]
  140. public string? SiteUrl { get; init; }
  141. [DisplayName("입금계좌 - 은행")]
  142. public string? BankCode { get; init; }
  143. [DisplayName("입금계좌 - 예금주")]
  144. public string? BankOwner { get; init; }
  145. [DisplayName("입금계좌 - 계좌번호")]
  146. public string? BankNumber { get; init; }
  147. }
  148. public sealed class AccountConfigDto
  149. {
  150. [DisplayName("회원가입 시 - 차단 여부")]
  151. public bool IsRegisterBlock { get; init; }
  152. [DisplayName("회원가입 시 - 이메일 인증 여부")]
  153. public bool IsRegisterEmailAuth { get; init; }
  154. [DisplayName("회원가입 시 - 비밀번호 최소 길이")]
  155. public ushort? PasswordMinLength { get; init; }
  156. [DisplayName("회원가입 시 - 비밀번호 대문자 최소 수")]
  157. public ushort? PasswordUppercaseLength { get; init; }
  158. [DisplayName("회원가입 시 - 비밀번호 숫자 최소 수")]
  159. public ushort? PasswordNumbersLength { get; init; }
  160. [DisplayName("회원가입 시 - 비밀번호 특수문자 최소 수")]
  161. public ushort? PasswordSpecialcharsLength { get; init; }
  162. [DisplayName("회원가입 시 - 금지 이메일")]
  163. public string? DeniedEmailList { get; init; }
  164. [DisplayName("회원가입 시 - 금지 별명")]
  165. public string? DeniedNameList { get; init; }
  166. [DisplayName("회원가입 시 - 이메일 변경 주기")]
  167. public ushort? ChangeEmailDay { get; init; }
  168. [DisplayName("회원가입 시 - 별명 변경 주기")]
  169. public ushort? ChangeNameDay { get; init; }
  170. [DisplayName("회원가입 시 - 한마디 변경 주기")]
  171. public ushort? ChangeSummaryDay { get; init; }
  172. [DisplayName("회원가입 시 - 자기소개 변경 주기")]
  173. public ushort? ChangeIntroDay { get; init; }
  174. [DisplayName("회원가입 시 - 프로필 이미지 변경 주기")]
  175. public ushort? ChangeThumbDay { get; init; }
  176. [DisplayName("회원가입 시 - 비밀번호 변경 주기")]
  177. public ushort? ChangePasswordDay { get; init; }
  178. [DisplayName("로그인 시 - 이메일 인증 필요")]
  179. public bool IsLoginEmailVerifiedOnly { get; init; }
  180. [DisplayName("로그인 시 - 로그인 시도(회)")]
  181. public ushort? MaxLoginTryCount { get; init; }
  182. [DisplayName("로그인 시 - 로그인 제한(초)")]
  183. public ushort? MaxLoginTryLimitSecond { get; init; }
  184. }
  185. public sealed class EmailTemplateConfigDto
  186. {
  187. [DisplayName("회원가입 시 - 제목")]
  188. public string? RegisterEmailFormTitle { get; init; }
  189. [DisplayName("회원가입 시 - 내용")]
  190. public string? RegisterEmailFormContent { get; init; }
  191. [DisplayName("회원가입 완료 - 제목")]
  192. public string? RegistrationEmailFormTitle { get; init; }
  193. [DisplayName("회원가입 완료 - 내용")]
  194. public string? RegistrationEmailFormContent { get; init; }
  195. [DisplayName("비밀번호 재설정 - 제목")]
  196. public string? ResetPasswordEmailFormTitle { get; init; }
  197. [DisplayName("비밀번호 재설정 - 내용")]
  198. public string? ResetPasswordEmailFormContent { get; init; }
  199. [DisplayName("비밀번호 변경 완료 - 제목")]
  200. public string? ChangedPasswordEmailFormTitle { get; init; }
  201. [DisplayName("비밀번호 변경 완료 - 내용")]
  202. public string? ChangedPasswordEmailFormContent { get; init; }
  203. [DisplayName("회원탈퇴 시 - 제목")]
  204. public string? WithdrawEmailFormTitle { get; init; }
  205. [DisplayName("회원탈퇴 시 - 내용")]
  206. public string? WithdrawEmailFormContent { get; init; }
  207. [DisplayName("회원탈퇴 인증 - 제목")]
  208. public string? WithdrawVerifyEmailFormTitle { get; init; }
  209. [DisplayName("회원탈퇴 인증 - 내용")]
  210. public string? WithdrawVerifyEmailFormContent { get; init; }
  211. [DisplayName("이메일 변경 시 - 제목")]
  212. public string? EmailVerifyFormTitle { get; init; }
  213. [DisplayName("이메일 변경 시 - 내용")]
  214. public string? EmailVerifyFormContent { get; init; }
  215. [DisplayName("이메일 변경 완료 - 제목")]
  216. public string? ChangedEmailFormTitle { get; init; }
  217. [DisplayName("이메일 변경 완료 - 내용")]
  218. public string? ChangedEmailFormContent { get; init; }
  219. }
  220. public sealed class ExternalApiConfigDto
  221. {
  222. [DisplayName("YouTube - API Name")]
  223. public string? YouTubeApiKeyEnc { get; init; }
  224. [DisplayName("YouTube - API Key")]
  225. public string? YouTubeApiName { get; init; }
  226. [DisplayName("Google - Client ID")]
  227. public string? GoogleClientId { get; init; }
  228. [DisplayName("Google - Client Secret")]
  229. public string? GoogleClientSecretEnc { get; init; }
  230. [DisplayName("Google - App ID")]
  231. public string? GoogleAppId { get; init; }
  232. // 소셜 로그인 on/off (Admin 체크박스) — 익명 공개 안전(비밀 아님)
  233. [DisplayName("네이버 로그인 사용")]
  234. public bool NaverLoginEnabled { get; init; } = true;
  235. [DisplayName("카카오 로그인 사용")]
  236. public bool KakaoLoginEnabled { get; init; } = true;
  237. [DisplayName("구글 로그인 사용")]
  238. public bool GoogleLoginEnabled { get; init; } = true;
  239. // OAuth — 관리자 확인용으로 키/시크릿 원문(복호화)까지 노출 (사용자 승인 — /api/config 익명 공개 포함)
  240. [DisplayName("네이버 - Client ID")]
  241. public string? NaverClientId { get; init; }
  242. [DisplayName("네이버 - Client Secret")]
  243. public string? NaverClientSecret { get; init; }
  244. [DisplayName("카카오 - REST API 키")]
  245. public string? KakaoRestApiKey { get; init; }
  246. [DisplayName("카카오 - JavaScript 키")]
  247. public string? KakaoJavascriptKey { get; init; }
  248. [DisplayName("카카오 - Admin 키")]
  249. public string? KakaoAdminKey { get; init; }
  250. [DisplayName("네이버검색 - Client ID")]
  251. public string? NaverSearchClientId { get; init; }
  252. [DisplayName("네이버검색 - Client Secret")]
  253. public string? NaverSearchClientSecret { get; init; }
  254. }
  255. // 데이터 수집 — 공개(/api/config)에는 암호문(enc) 그대로 노출 — 복호화 평문은 Admin 화면에서만
  256. public sealed class DataCollectionConfigDto
  257. {
  258. public string? DataGoKrServiceKey { get; init; }
  259. public string? KrxApiKey { get; init; }
  260. public string? OpenDartApiKey { get; init; }
  261. public string? KoreaEximExchangeKey { get; init; }
  262. public string? KoreaEximLoanRateKey { get; init; }
  263. public string? KoreaEximIntlRateKey { get; init; }
  264. public string? SeibroApiKey { get; init; }
  265. public string? KosisApiKey { get; init; }
  266. public bool StockDataMasterSync { get; init; }
  267. public bool StockDataDailyPriceSync { get; init; }
  268. public bool KrxIndexSync { get; init; }
  269. public bool KrxBondIndexSync { get; init; }
  270. public bool KrxStockSync { get; init; }
  271. public bool KrxEtpSync { get; init; }
  272. public bool KrxWarrantSync { get; init; }
  273. public bool KrxBondSync { get; init; }
  274. public bool KrxDerivativeSync { get; init; }
  275. public bool KrxCommoditySync { get; init; }
  276. public bool KrxEsgSync { get; init; }
  277. public bool OpenDartDisclosureSync { get; init; }
  278. public bool KoreaEximMacroSync { get; init; }
  279. public bool KosisSync { get; init; }
  280. public bool WorldIndexEnabled { get; init; }
  281. public bool MarketQuoteEnabled { get; init; }
  282. public bool SeibroIssuerSync { get; init; }
  283. public bool SeibroDividendSync { get; init; }
  284. public bool SeibroSupplySync { get; init; }
  285. public bool SeibroCorpActionSync { get; init; }
  286. public bool SeibroBondSync { get; init; }
  287. public bool SeibroDerivSync { get; init; }
  288. public bool SeibroForeignSync { get; init; }
  289. }
  290. // 토스페이먼츠 결제 설정 — 키 원문/암호문은 응답에 싣지 않는다 (설정 여부만 노출)
  291. public sealed class TossConfigDto
  292. {
  293. [DisplayName("토스 - 결제 환경")]
  294. public string? TossPayMode { get; init; }
  295. [DisplayName("토스 - Test Client Key 설정 여부")]
  296. public bool HasTestClientKey { get; init; }
  297. [DisplayName("토스 - Test Secret Key 설정 여부")]
  298. public bool HasTestSecretKey { get; init; }
  299. [DisplayName("토스 - Live Client Key 설정 여부")]
  300. public bool HasLiveClientKey { get; init; }
  301. [DisplayName("토스 - Live Secret Key 설정 여부")]
  302. public bool HasLiveSecretKey { get; init; }
  303. }
  304. public sealed class AttendanceConfigDto
  305. {
  306. [DisplayName("출석 기능 활성화")]
  307. public bool IsEnabled { get; init; } = false;
  308. [DisplayName("기본 경험치")]
  309. public int BaseExp { get; init; } = 0;
  310. [DisplayName("기본 코인")]
  311. public int BasePoint { get; init; } = 0;
  312. [DisplayName("연속 출석 가중치 사용")]
  313. public bool UseStreakBonus { get; init; } = false;
  314. [DisplayName("1일당 추가 경험치")]
  315. public int StreakBonusPerDay { get; init; } = 0;
  316. [DisplayName("1일당 추가 코인")]
  317. public int StreakBonusPointPerDay { get; init; } = 0;
  318. [DisplayName("가중치 최대 적용 일수")]
  319. public int StreakBonusMaxDays { get; init; } = 0;
  320. [DisplayName("순위 보상 사용")]
  321. public bool UseRankBonus { get; init; } = false;
  322. [DisplayName("순위별 보상 설정 (JSON)")]
  323. public string? RankBonusConfig { get; init; }
  324. }
  325. public sealed class SignupRewardConfigDto
  326. {
  327. [DisplayName("가입 축하 보상 활성화")]
  328. public bool Enabled { get; init; } = false;
  329. [DisplayName("지급 코인")]
  330. public int CoinAmount { get; init; } = 0;
  331. [DisplayName("지급 캐시")]
  332. public int CashAmount { get; init; } = 0;
  333. [DisplayName("지급 경험치")]
  334. public int ExpAmount { get; init; } = 0;
  335. }
  336. public sealed class RewardConfigDto
  337. {
  338. [DisplayName("게시글 경험치")]
  339. public int PostExp { get; init; } = 0;
  340. [DisplayName("게시글 토큰")]
  341. public int PostPoint { get; init; } = 0;
  342. [DisplayName("댓글 경험치")]
  343. public int CommentExp { get; init; } = 0;
  344. [DisplayName("댓글 토큰")]
  345. public int CommentPoint { get; init; } = 0;
  346. [DisplayName("추천(누른 쪽) 경험치")]
  347. public int LikeGivenExp { get; init; } = 0;
  348. [DisplayName("추천(받은 쪽) 토큰")]
  349. public int LikeReceivedPoint { get; init; } = 0;
  350. [DisplayName("최소 게시글 길이")]
  351. public int MinPostLength { get; init; } = 0;
  352. [DisplayName("최소 댓글 길이")]
  353. public int MinCommentLength { get; init; } = 0;
  354. [DisplayName("신규 회원 보상 유예(일)")]
  355. public int NewMemberHoldDays { get; init; } = 0;
  356. [DisplayName("게시글 일일 횟수 상한")]
  357. public int PostDailyCount { get; init; } = 0;
  358. [DisplayName("게시글 일일 경험치 상한")]
  359. public int PostDailyExp { get; init; } = 0;
  360. [DisplayName("게시글 일일 토큰 상한")]
  361. public int PostDailyPoint { get; init; } = 0;
  362. [DisplayName("댓글 일일 횟수 상한")]
  363. public int CommentDailyCount { get; init; } = 0;
  364. [DisplayName("댓글 일일 경험치 상한")]
  365. public int CommentDailyExp { get; init; } = 0;
  366. [DisplayName("댓글 일일 토큰 상한")]
  367. public int CommentDailyPoint { get; init; } = 0;
  368. [DisplayName("추천(누른 쪽) 일일 횟수 상한")]
  369. public int LikeGivenDailyCount { get; init; } = 0;
  370. [DisplayName("추천(누른 쪽) 일일 경험치 상한")]
  371. public int LikeGivenDailyExp { get; init; } = 0;
  372. [DisplayName("추천(받은 쪽) 일일 횟수 상한")]
  373. public int LikeReceivedDailyCount { get; init; } = 0;
  374. [DisplayName("추천(받은 쪽) 일일 토큰 상한")]
  375. public int LikeReceivedDailyPoint { get; init; } = 0;
  376. [DisplayName("채팅 일일 횟수 상한")]
  377. public int ChatDailyCount { get; init; } = 0;
  378. [DisplayName("채팅 일일 경험치 상한")]
  379. public int ChatDailyExp { get; init; } = 0;
  380. [DisplayName("응원 수수료율(%)")]
  381. public int CheerFeePercent { get; init; } = 20;
  382. [DisplayName("응원 최소 금액")]
  383. public int CheerMinAmount { get; init; } = 100;
  384. [DisplayName("응원 일일 발신 총액 상한(0=무제한)")]
  385. public int CheerDailyMax { get; init; } = 0;
  386. }
  387. public sealed class PaperConfigDto
  388. {
  389. [DisplayName("모의투자 활성화")]
  390. public bool Enabled { get; init; } = true;
  391. [DisplayName("매매 수수료(Bp)")]
  392. public int FeeRateBp { get; init; } = 15;
  393. [DisplayName("거래세(Bp)")]
  394. public int TaxRateBp { get; init; } = 18;
  395. [DisplayName("최소 입금 토큰")]
  396. public int MinDeposit { get; init; } = 10000;
  397. [DisplayName("최대 보유 토큰(0=무제한)")]
  398. public int MaxHolding { get; init; } = 0;
  399. [DisplayName("출금 수익 소각(Bp, 0=사용안함)")]
  400. public int WithdrawProfitBurnBp { get; init; } = 0;
  401. [DisplayName("1주문 상한(Bp, 3000=30%)")]
  402. public int OrderMaxPctBp { get; init; } = 3000;
  403. [DisplayName("리더보드 등재 최소 체결수")]
  404. public int MinFillsForRank { get; init; } = 3;
  405. }
  406. }