Request.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. using Microsoft.AspNetCore.Http;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. namespace Application.Features.Config.Update;
  5. public sealed class Request
  6. {
  7. public int ID { get; set; }
  8. public BasicConfigDto Basic { get; set; } = new();
  9. public ImagesConfigDto Images { get; set; } = new();
  10. public MetaConfigDto Meta { get; set; } = new();
  11. public CompanyConfigDto Company { get; set; } = new();
  12. public AccountConfigDto Account { get; set; } = new();
  13. public EmailTemplateConfigDto EmailTemplate { get; set; } = new();
  14. public ExternalApiConfigDto External { get; set; } = new();
  15. public TossConfigDto Toss { get; set; } = new();
  16. public AttendanceConfigDto? Attendance { get; set; }
  17. public SignupRewardConfigDto? SignupReward { get; set; }
  18. public RewardConfigDto? Reward { get; set; }
  19. public PaperConfigDto? Paper { get; set; }
  20. public DataCollectionConfigDto? DataCollection { get; set; }
  21. // 기본 설정
  22. public sealed class BasicConfigDto
  23. {
  24. [MaxLength(100)]
  25. [DisplayName("사이트 이름")]
  26. public string? SiteName { get; set; }
  27. [MaxLength(100)]
  28. [DataType(DataType.Url)]
  29. [DisplayName("사이트 주소")]
  30. public string? SiteURL { get; set; }
  31. [DisplayName("최고 관리자 ID")]
  32. public string? RootID { get; set; }
  33. [MaxLength(100)]
  34. [DataType(DataType.EmailAddress)]
  35. [DisplayName("발송자 이메일")]
  36. public string? FromEmail { get; set; }
  37. [MaxLength(30)]
  38. [DisplayName("발송자 이름")]
  39. public string? FromName { get; set; }
  40. [MaxLength(200)]
  41. [DisplayName("SMTP Server")]
  42. public string? SmtpServer { get; set; }
  43. [Range(1, 65535)]
  44. [DisplayName("SMTP Port")]
  45. public int? SmtpPort { get; set; }
  46. [DisplayName("SMTP Enable SSL")]
  47. public bool SmtpEnableSSL { get; set; } = false;
  48. [MaxLength(100)]
  49. [DisplayName("SMTP Username")]
  50. public string? SmtpUsername { get; set; }
  51. [MaxLength(200)]
  52. [DataType(DataType.Password)]
  53. [DisplayName("SMTP Password")]
  54. public string? SmtpPassword { get; set; }
  55. [MaxLength(200)]
  56. [DataType(DataType.MultilineText)]
  57. [DisplayName("관리자단 접근 가능 IP")]
  58. public string? AdminWhiteIPList { get; set; }
  59. [MaxLength(200)]
  60. [DataType(DataType.MultilineText)]
  61. [DisplayName("사용자단 접근 가능 IP")]
  62. public string? FrontWhiteIPList { get; set; }
  63. [MaxLength(200)]
  64. [DisplayName("차단 시 안내문 제목")]
  65. public string? BlockAlertTitle { get; set; }
  66. [MaxLength(5000)]
  67. [DataType(DataType.MultilineText)]
  68. [DisplayName("차단 시 안내문 내용")]
  69. public string? BlockAlertContent { get; set; }
  70. [DisplayName("점검 여부")]
  71. public bool IsMaintenance { get; set; } = false;
  72. [MaxLength(5000)]
  73. [DataType(DataType.MultilineText)]
  74. [DisplayName("점검 내용")]
  75. public string? MaintenanceContent { get; set; }
  76. [Range(0, 100)]
  77. [DisplayName("쪽지 일일 발송 제한")]
  78. public int NoteDailySendLimit { get; set; } = 3;
  79. }
  80. // 이미지 경로 및 업로드 입력
  81. public sealed class ImagesConfigDto
  82. {
  83. // ====== DB에 저장/표기할 경로(문자열) ======
  84. [MaxLength(255)]
  85. [DisplayName("Favicon")]
  86. public string? FaviconPath { get; set; }
  87. [MaxLength(255)]
  88. [DisplayName("Logo-square")]
  89. public string? LogoSquarePath { get; set; }
  90. [MaxLength(255)]
  91. [DisplayName("Logo-horizontal")]
  92. public string? LogoHorizontalPath { get; set; }
  93. [MaxLength(255)]
  94. [DisplayName("og-default")]
  95. public string? OgDefaultPath { get; set; }
  96. [MaxLength(255)]
  97. [DisplayName("Twitter-image")]
  98. public string? TwitterImagePath { get; set; }
  99. [MaxLength(255)]
  100. [DisplayName("Apple-touch-icon")]
  101. public string? AppleTouchIconPath { get; set; }
  102. [MaxLength(255)]
  103. [DisplayName("App-icon-192")]
  104. public string? AppIcon192Path { get; set; }
  105. [MaxLength(255)]
  106. [DisplayName("App-icon-512")]
  107. public string? AppIcon512Path { get; set; }
  108. // ====== 업로드 입력(새 업로드용) ======
  109. [DataType(DataType.Upload)]
  110. [DisplayName("Favicon 업로드")]
  111. public IFormFile? FaviconFile { get; set; }
  112. [DataType(DataType.Upload)]
  113. [DisplayName("Logo-square 업로드")]
  114. public IFormFile? LogoSquareFile { get; set; }
  115. [DataType(DataType.Upload)]
  116. [DisplayName("Logo-horizontal 업로드")]
  117. public IFormFile? LogoHorizontalFile { get; set; }
  118. [DataType(DataType.Upload)]
  119. [DisplayName("og-default 업로드")]
  120. public IFormFile? OgDefaultFile { get; set; }
  121. [DataType(DataType.Upload)]
  122. [DisplayName("Twitter-image 업로드")]
  123. public IFormFile? TwitterImageFile { get; set; }
  124. [DataType(DataType.Upload)]
  125. [DisplayName("Apple-touch-icon 업로드")]
  126. public IFormFile? AppleTouchIconFile { get; set; }
  127. [DataType(DataType.Upload)]
  128. [DisplayName("App-icon-192 업로드")]
  129. public IFormFile? AppIcon192File { get; set; }
  130. [DataType(DataType.Upload)]
  131. [DisplayName("App-icon-512 업로드")]
  132. public IFormFile? AppIcon512File { get; set; }
  133. }
  134. // 메타 태그
  135. public sealed class MetaConfigDto
  136. {
  137. [MaxLength(255)]
  138. [DisplayName("Meta Keywords")]
  139. public string? Keywords { get; set; }
  140. [MaxLength(255)]
  141. [DisplayName("Meta Description")]
  142. public string? Description { get; set; }
  143. [MaxLength(255)]
  144. [DisplayName("Meta Author")]
  145. public string? Author { get; set; }
  146. [MaxLength(255)]
  147. [DisplayName("Meta Viewport")]
  148. public string? Viewport { get; set; }
  149. [MaxLength(255)]
  150. [DisplayName("Meta ApplicationName")]
  151. public string? ApplicationName { get; set; }
  152. [MaxLength(255)]
  153. [DisplayName("Meta Generator")]
  154. public string? Generator { get; set; }
  155. [MaxLength(255)]
  156. [DisplayName("Meta Robots")]
  157. public string? Robots { get; set; }
  158. [MaxLength(3000)]
  159. [DataType(DataType.MultilineText)]
  160. [DisplayName("Meta Adds")]
  161. public string? Adds { get; set; }
  162. }
  163. // 회사 정보
  164. public sealed class CompanyConfigDto
  165. {
  166. [MaxLength(70)]
  167. [DisplayName("상호 명")]
  168. public string? Name { get; set; }
  169. [MaxLength(100)]
  170. [DisplayName("사업자 등록 번호")]
  171. public string? RegNo { get; set; }
  172. [MaxLength(255)]
  173. [DisplayName("사업장 소재지")]
  174. public string? Address { get; set; }
  175. [MaxLength(8)]
  176. [DataType(DataType.PostalCode)]
  177. [DisplayName("우편번호")]
  178. public string? ZipCode { get; set; }
  179. [MaxLength(50)]
  180. [DisplayName("대표자 명")]
  181. public string? Owner { get; set; }
  182. [MaxLength(20)]
  183. [DisplayName("대표 전화번호")]
  184. public string? Tel { get; set; }
  185. [MaxLength(20)]
  186. [DisplayName("FAX")]
  187. public string? Fax { get; set; }
  188. [MaxLength(20)]
  189. [DisplayName("통신판매업 신고번호")]
  190. public string? RetailSaleNo { get; set; }
  191. [MaxLength(20)]
  192. [DisplayName("부가통신 사업자번호")]
  193. public string? AddedSaleNo { get; set; }
  194. [MaxLength(100)]
  195. [DisplayName("호스팅 서비스")]
  196. public string? Hosting { get; set; }
  197. [MaxLength(70)]
  198. [DisplayName("정보관리책임자")]
  199. public string? AdminName { get; set; }
  200. [MaxLength(100)]
  201. [DataType(DataType.EmailAddress)]
  202. [DisplayName("정보관리책임자 이메일")]
  203. public string? AdminEmail { get; set; }
  204. [MaxLength(200)]
  205. [DataType(DataType.Url)]
  206. [DisplayName("사이트 주소")]
  207. public string? SiteUrl { get; set; }
  208. [MaxLength(10)]
  209. [DisplayName("입금계좌 - 은행")]
  210. public string? BankCode { get; set; }
  211. [MaxLength(70)]
  212. [DisplayName("입금계좌 - 예금주")]
  213. public string? BankOwner { get; set; }
  214. [MaxLength(100)]
  215. [DisplayName("입금계좌 - 계좌번호")]
  216. public string? BankNumber { get; set; }
  217. }
  218. // 회원 설정
  219. public sealed class AccountConfigDto
  220. {
  221. [DisplayName("회원가입 시 - 가입 차단")]
  222. public bool IsRegisterBlock { get; set; } = false;
  223. [DisplayName("회원가입 시 - 이메일 인증 여부")]
  224. public bool IsRegisterEmailAuth { get; set; } = false;
  225. [Range(0, 100)]
  226. [DisplayName("회원가입 시 - 비밀번호 최소 길이")]
  227. public ushort? PasswordMinLength { get; set; }
  228. [Range(0, 100)]
  229. [DisplayName("회원가입 시 - 비밀번호 대문자 최소 길이")]
  230. public ushort? PasswordUppercaseLength { get; set; }
  231. [Range(0, 100)]
  232. [DisplayName("회원가입 시 - 비밀번호 숫자 최소 길이")]
  233. public ushort? PasswordNumbersLength { get; set; }
  234. [Range(0, 100)]
  235. [DisplayName("회원가입 시 - 비밀번호 특수문자 최소 길이")]
  236. public ushort? PasswordSpecialcharsLength { get; set; }
  237. [MaxLength(4000)]
  238. [DisplayName("회원가입 시 - 금지 이메일")]
  239. public string? DeniedEmailList { get; set; }
  240. [MaxLength(4000)]
  241. [DisplayName("회원가입 시 - 금지 별명")]
  242. public string? DeniedNameList { get; set; }
  243. [Range(0, 365)]
  244. [DisplayName("회원가입 시 - 이메일 갱신 주기")]
  245. public ushort? ChangeEmailDay { get; set; }
  246. [Range(0, 365)]
  247. [DisplayName("회원가입 시 - 별명 갱신 주기")]
  248. public ushort? ChangeNameDay { get; set; }
  249. [Range(0, 365)]
  250. [DisplayName("회원가입 시 - 한마디 갱신 주기")]
  251. public ushort? ChangeSummaryDay { get; set; }
  252. [Range(0, 365)]
  253. [DisplayName("회원가입 시 - 자기소개 갱신 주기")]
  254. public ushort? ChangeIntroDay { get; set; }
  255. [Range(0, 365)]
  256. [DisplayName("회원가입 시 - 비밀번호 갱신 주기")]
  257. public ushort? ChangePasswordDay { get; set; }
  258. [DisplayName("로그인 시 - 이메일 인증 필요")]
  259. public bool IsLoginEmailVerifiedOnly { get; set; } = false;
  260. [Range(0, 100)]
  261. [DisplayName("로그인 시 - 로그인 시도(회)")]
  262. public ushort? MaxLoginTryCount { get; set; }
  263. [Range(0, 86400)]
  264. [DisplayName("로그인 시 - 로그인 제한(초)")]
  265. public ushort? MaxLoginTryLimitSecond { get; set; }
  266. }
  267. // 알림 발송 양식
  268. public sealed class EmailTemplateConfigDto
  269. {
  270. [MaxLength(4000)]
  271. [DisplayName("회원가입 시 - 제목")]
  272. public string? RegisterEmailFormTitle { get; set; }
  273. [MaxLength(4000)]
  274. [DisplayName("회원가입 시 - 내용")]
  275. public string? RegisterEmailFormContent { get; set; }
  276. [MaxLength(4000)]
  277. [DisplayName("회원가입 완료 - 제목")]
  278. public string? RegistrationEmailFormTitle { get; set; }
  279. [MaxLength(4000)]
  280. [DisplayName("회원가입 완료 - 내용")]
  281. public string? RegistrationEmailFormContent { get; set; }
  282. [MaxLength(4000)]
  283. [DisplayName("비밀번호 재설정 - 제목")]
  284. public string? ResetPasswordEmailFormTitle { get; set; }
  285. [MaxLength(4000)]
  286. [DisplayName("비밀번호 재설정 - 내용")]
  287. public string? ResetPasswordEmailFormContent { get; set; }
  288. [MaxLength(4000)]
  289. [DisplayName("비밀번호 변경 완료 - 제목")]
  290. public string? ChangedPasswordEmailFormTitle { get; set; }
  291. [MaxLength(4000)]
  292. [DisplayName("비밀번호 변경 완료 - 내용")]
  293. public string? ChangedPasswordEmailFormContent { get; set; }
  294. [MaxLength(4000)]
  295. [DisplayName("회원탈퇴 시 - 제목")]
  296. public string? WithdrawEmailFormTitle { get; set; }
  297. [MaxLength(4000)]
  298. [DisplayName("회원탈퇴 시 - 내용")]
  299. public string? WithdrawEmailFormContent { get; set; }
  300. [MaxLength(4000)]
  301. [DisplayName("회원탈퇴 인증 - 제목")]
  302. public string? WithdrawVerifyEmailFormTitle { get; set; }
  303. [MaxLength(4000)]
  304. [DisplayName("회원탈퇴 인증 - 내용")]
  305. public string? WithdrawVerifyEmailFormContent { get; set; }
  306. [MaxLength(4000)]
  307. [DisplayName("이메일 변경 시 - 제목")]
  308. public string? EmailVerifyFormTitle { get; set; }
  309. [MaxLength(4000)]
  310. [DisplayName("이메일 변경 시 - 내용")]
  311. public string? EmailVerifyFormContent { get; set; }
  312. [MaxLength(4000)]
  313. [DisplayName("이메일 변경 완료 - 제목")]
  314. public string? ChangedEmailFormTitle { get; set; }
  315. [MaxLength(4000)]
  316. [DisplayName("이메일 변경 완료 - 내용")]
  317. public string? ChangedEmailFormContent { get; set; }
  318. }
  319. // API 정보
  320. public sealed class ExternalApiConfigDto
  321. {
  322. [MaxLength(500)]
  323. [DisplayName("YouTube - API Name")]
  324. public string? YouTubeApiKeyEnc { get; set; }
  325. [MaxLength(500)]
  326. [DisplayName("YouTube - API Key")]
  327. public string? YouTubeApiName { get; set; }
  328. [MaxLength(500)]
  329. [DisplayName("Google - Client ID")]
  330. public string? GoogleClientId { get; set; }
  331. [MaxLength(500)]
  332. [DisplayName("Google - Client Secret")]
  333. public string? GoogleClientSecretEnc { get; set; }
  334. [MaxLength(500)]
  335. [DisplayName("Google - App ID")]
  336. public string? GoogleAppId { get; set; }
  337. // 소셜 로그인 (OAuth) — 비밀 키는 빈 값 제출 시 기존 유지(입력 시 암호화 저장), ID/JS 키는 직접 저장
  338. [MaxLength(500)]
  339. [DisplayName("네이버 - Client ID")]
  340. public string? NaverClientId { get; set; }
  341. [MaxLength(500)]
  342. [DisplayName("네이버 - Client Secret")]
  343. public string? NaverClientSecret { get; set; }
  344. [MaxLength(500)]
  345. [DisplayName("카카오 - REST API 키")]
  346. public string? KakaoRestApiKey { get; set; }
  347. [MaxLength(500)]
  348. [DisplayName("카카오 - JavaScript 키")]
  349. public string? KakaoJavascriptKey { get; set; }
  350. [MaxLength(500)]
  351. [DisplayName("카카오 - Admin 키")]
  352. public string? KakaoAdminKey { get; set; }
  353. [MaxLength(500)]
  354. [DisplayName("네이버검색 - Client ID")]
  355. public string? NaverSearchClientId { get; set; }
  356. [MaxLength(500)]
  357. [DisplayName("네이버검색 - Client Secret")]
  358. public string? NaverSearchClientSecret { get; set; }
  359. }
  360. // 데이터 수집 API 키 + 수집기 활성화. 키는 빈 값 제출 시 기존 유지(입력 시 암호화 저장), 플래그는 수집기 on/off.
  361. public sealed class DataCollectionConfigDto
  362. {
  363. [MaxLength(1000)]
  364. [DisplayName("금융위 data.go.kr ServiceKey")]
  365. public string? DataGoKrServiceKey { get; set; }
  366. [MaxLength(1000)]
  367. [DisplayName("KRX AUTH_KEY")]
  368. public string? KrxApiKey { get; set; }
  369. [MaxLength(1000)]
  370. [DisplayName("OpenDART crtfc_key")]
  371. public string? OpenDartApiKey { get; set; }
  372. [MaxLength(1000)]
  373. [DisplayName("수출입은행 환율(AP01) authkey")]
  374. public string? KoreaEximExchangeKey { get; set; }
  375. [MaxLength(1000)]
  376. [DisplayName("수출입은행 대출금리(AP02) authkey")]
  377. public string? KoreaEximLoanRateKey { get; set; }
  378. [MaxLength(1000)]
  379. [DisplayName("수출입은행 국제금리(AP03) authkey")]
  380. public string? KoreaEximIntlRateKey { get; set; }
  381. [MaxLength(1000)]
  382. [DisplayName("SEIBro key")]
  383. public string? SeibroApiKey { get; set; }
  384. [MaxLength(1000)]
  385. [DisplayName("KOSIS apiKey")]
  386. public string? KosisApiKey { get; set; }
  387. // 수집기 활성화 플래그
  388. public bool StockDataMasterSync { get; set; }
  389. public bool StockDataDailyPriceSync { get; set; }
  390. public bool KrxIndexSync { get; set; }
  391. public bool KrxBondIndexSync { get; set; }
  392. public bool KrxStockSync { get; set; }
  393. public bool KrxEtpSync { get; set; }
  394. public bool KrxWarrantSync { get; set; }
  395. public bool KrxBondSync { get; set; }
  396. public bool KrxDerivativeSync { get; set; }
  397. public bool KrxCommoditySync { get; set; }
  398. public bool KrxEsgSync { get; set; }
  399. public bool OpenDartDisclosureSync { get; set; }
  400. public bool KoreaEximMacroSync { get; set; }
  401. public bool KosisSync { get; set; }
  402. public bool WorldIndexEnabled { get; set; }
  403. public bool MarketQuoteEnabled { get; set; }
  404. public bool SeibroIssuerSync { get; set; }
  405. public bool SeibroDividendSync { get; set; }
  406. public bool SeibroSupplySync { get; set; }
  407. public bool SeibroCorpActionSync { get; set; }
  408. public bool SeibroBondSync { get; set; }
  409. public bool SeibroDerivSync { get; set; }
  410. public bool SeibroForeignSync { get; set; }
  411. }
  412. // 토스페이먼츠 결제 설정 (결제 설정 화면 전용)
  413. // 키 입력값은 저장 시 암호화되며, 빈 값으로 제출하면 기존 저장 키를 유지한다.
  414. public sealed class TossConfigDto
  415. {
  416. [DisplayName("토스 - 결제 환경")]
  417. public string? TossPayMode { get; set; }
  418. [MaxLength(500)]
  419. [DisplayName("토스 - Test Client Key")]
  420. public string? TestClientKey { get; set; }
  421. [MaxLength(500)]
  422. [DisplayName("토스 - Test Secret Key")]
  423. public string? TestSecretKey { get; set; }
  424. [MaxLength(500)]
  425. [DisplayName("토스 - Live Client Key")]
  426. public string? LiveClientKey { get; set; }
  427. [MaxLength(500)]
  428. [DisplayName("토스 - Live Secret Key")]
  429. public string? LiveSecretKey { get; set; }
  430. }
  431. // 출석 설정
  432. public sealed class AttendanceConfigDto
  433. {
  434. [DisplayName("출석 기능 활성화")]
  435. public bool IsEnabled { get; set; } = false;
  436. [Range(0, 100000)]
  437. [DisplayName("기본 경험치")]
  438. public int BaseExp { get; set; } = 0;
  439. [Range(0, 100000)]
  440. [DisplayName("기본 코인")]
  441. public int BasePoint { get; set; } = 0;
  442. [DisplayName("연속 출석 가중치 사용")]
  443. public bool UseStreakBonus { get; set; } = false;
  444. [Range(0, 10000)]
  445. [DisplayName("1일당 추가 경험치")]
  446. public int StreakBonusPerDay { get; set; } = 0;
  447. [Range(0, 10000)]
  448. [DisplayName("1일당 추가 코인")]
  449. public int StreakBonusPointPerDay { get; set; } = 0;
  450. [Range(0, 365)]
  451. [DisplayName("가중치 최대 적용 일수")]
  452. public int StreakBonusMaxDays { get; set; } = 0;
  453. [DisplayName("순위 보상 사용")]
  454. public bool UseRankBonus { get; set; } = false;
  455. [MaxLength(2000)]
  456. [DisplayName("순위별 보상 설정 (JSON)")]
  457. public string? RankBonusConfig { get; set; }
  458. }
  459. // 가입 축하 보상 설정
  460. public sealed class SignupRewardConfigDto
  461. {
  462. [DisplayName("가입 축하 보상 활성화")]
  463. public bool Enabled { get; set; } = false;
  464. [Range(0, 100000000)]
  465. [DisplayName("지급 코인")]
  466. public int CoinAmount { get; set; } = 0;
  467. [Range(0, 100000000)]
  468. [DisplayName("지급 캐시")]
  469. public int CashAmount { get; set; } = 0;
  470. [Range(0, 100000)]
  471. [DisplayName("지급 경험치")]
  472. public int ExpAmount { get; set; } = 0;
  473. }
  474. // 보상 엔진 설정 (Reward) — d3 M2. ActivityToken 대체·통합.
  475. public sealed class RewardConfigDto
  476. {
  477. [Range(0, 100000000)]
  478. [DisplayName("게시글 경험치")]
  479. public int PostExp { get; set; } = 0;
  480. [Range(0, 100000000)]
  481. [DisplayName("게시글 토큰")]
  482. public int PostPoint { get; set; } = 0;
  483. [Range(0, 100000000)]
  484. [DisplayName("댓글 경험치")]
  485. public int CommentExp { get; set; } = 0;
  486. [Range(0, 100000000)]
  487. [DisplayName("댓글 토큰")]
  488. public int CommentPoint { get; set; } = 0;
  489. [Range(0, 100000000)]
  490. [DisplayName("추천(누른 쪽) 경험치")]
  491. public int LikeGivenExp { get; set; } = 0;
  492. [Range(0, 100000000)]
  493. [DisplayName("추천(받은 쪽) 토큰")]
  494. public int LikeReceivedPoint { get; set; } = 0;
  495. [Range(0, 100000)]
  496. [DisplayName("최소 게시글 길이")]
  497. public int MinPostLength { get; set; } = 0;
  498. [Range(0, 100000)]
  499. [DisplayName("최소 댓글 길이")]
  500. public int MinCommentLength { get; set; } = 0;
  501. [Range(0, 3650)]
  502. [DisplayName("신규 회원 보상 유예(일)")]
  503. public int NewMemberHoldDays { get; set; } = 0;
  504. [Range(0, 100000000)]
  505. [DisplayName("게시글 일일 횟수 상한")]
  506. public int PostDailyCount { get; set; } = 0;
  507. [Range(0, 100000000)]
  508. [DisplayName("게시글 일일 경험치 상한")]
  509. public int PostDailyExp { get; set; } = 0;
  510. [Range(0, 100000000)]
  511. [DisplayName("게시글 일일 토큰 상한")]
  512. public int PostDailyPoint { get; set; } = 0;
  513. [Range(0, 100000000)]
  514. [DisplayName("댓글 일일 횟수 상한")]
  515. public int CommentDailyCount { get; set; } = 0;
  516. [Range(0, 100000000)]
  517. [DisplayName("댓글 일일 경험치 상한")]
  518. public int CommentDailyExp { get; set; } = 0;
  519. [Range(0, 100000000)]
  520. [DisplayName("댓글 일일 토큰 상한")]
  521. public int CommentDailyPoint { get; set; } = 0;
  522. [Range(0, 100000000)]
  523. [DisplayName("추천(누른 쪽) 일일 횟수 상한")]
  524. public int LikeGivenDailyCount { get; set; } = 0;
  525. [Range(0, 100000000)]
  526. [DisplayName("추천(누른 쪽) 일일 경험치 상한")]
  527. public int LikeGivenDailyExp { get; set; } = 0;
  528. [Range(0, 100000000)]
  529. [DisplayName("추천(받은 쪽) 일일 횟수 상한")]
  530. public int LikeReceivedDailyCount { get; set; } = 0;
  531. [Range(0, 100000000)]
  532. [DisplayName("추천(받은 쪽) 일일 토큰 상한")]
  533. public int LikeReceivedDailyPoint { get; set; } = 0;
  534. [Range(0, 100000000)]
  535. [DisplayName("채팅 일일 횟수 상한")]
  536. public int ChatDailyCount { get; set; } = 0;
  537. [Range(0, 100000000)]
  538. [DisplayName("채팅 일일 경험치 상한")]
  539. public int ChatDailyExp { get; set; } = 0;
  540. [Range(0, 100)]
  541. [DisplayName("응원 수수료율(%)")]
  542. public int CheerFeePercent { get; set; } = 20;
  543. [Range(0, 100000000)]
  544. [DisplayName("응원 최소 금액")]
  545. public int CheerMinAmount { get; set; } = 100;
  546. [Range(0, 2000000000)]
  547. [DisplayName("응원 일일 발신 총액 상한(0=무제한)")]
  548. public int CheerDailyMax { get; set; } = 0;
  549. }
  550. // 모의투자 설정 (Paper) — d4 §④
  551. public sealed class PaperConfigDto
  552. {
  553. [DisplayName("모의투자 활성화")]
  554. public bool Enabled { get; set; } = true;
  555. [Range(0, 100000)]
  556. [DisplayName("매매 수수료(Bp)")]
  557. public int FeeRateBp { get; set; } = 15;
  558. [Range(0, 100000)]
  559. [DisplayName("거래세(Bp)")]
  560. public int TaxRateBp { get; set; } = 18;
  561. [Range(0, 1000000000)]
  562. [DisplayName("최소 입금 토큰")]
  563. public int MinDeposit { get; set; } = 10000;
  564. [Range(0, 2000000000)]
  565. [DisplayName("최대 보유 토큰(0=무제한)")]
  566. public int MaxHolding { get; set; } = 0;
  567. [Range(0, 10000)]
  568. [DisplayName("출금 수익 소각(Bp, 0=사용안함)")]
  569. public int WithdrawProfitBurnBp { get; set; } = 0;
  570. [Range(0, 10000)]
  571. [DisplayName("1주문 상한(Bp, 3000=30%)")]
  572. public int OrderMaxPctBp { get; set; } = 3000;
  573. [Range(0, 100000)]
  574. [DisplayName("리더보드 등재 최소 체결수")]
  575. public int MinFillsForRank { get; set; } = 3;
  576. }
  577. public static Request From(Get.Response src) => new()
  578. {
  579. ID = src.ID,
  580. Basic = new BasicConfigDto
  581. {
  582. SiteName = src.Basic.SiteName,
  583. SiteURL = src.Basic.SiteURL,
  584. RootID = src.Basic.RootID,
  585. FromEmail = src.Basic.FromEmail,
  586. FromName = src.Basic.FromName,
  587. SmtpServer = src.Basic.SmtpServer,
  588. SmtpPort = src.Basic.SmtpPort,
  589. SmtpEnableSSL = src.Basic.SmtpEnableSSL,
  590. SmtpUsername = src.Basic.SmtpUsername,
  591. SmtpPassword = src.Basic.SmtpPassword,
  592. AdminWhiteIPList = src.Basic.AdminWhiteIPList,
  593. FrontWhiteIPList = src.Basic.FrontWhiteIPList,
  594. BlockAlertTitle = src.Basic.BlockAlertTitle,
  595. BlockAlertContent = src.Basic.BlockAlertContent,
  596. IsMaintenance = src.Basic.IsMaintenance,
  597. MaintenanceContent = src.Basic.MaintenanceContent,
  598. NoteDailySendLimit = src.Basic.NoteDailySendLimit
  599. },
  600. Images = new ImagesConfigDto
  601. {
  602. FaviconPath = src.Images.FaviconPath,
  603. LogoSquarePath = src.Images.LogoSquarePath,
  604. LogoHorizontalPath = src.Images.LogoHorizontalPath,
  605. OgDefaultPath = src.Images.OgDefaultPath,
  606. TwitterImagePath = src.Images.TwitterImagePath,
  607. AppleTouchIconPath = src.Images.AppleTouchIconPath,
  608. AppIcon192Path = src.Images.AppIcon192Path,
  609. AppIcon512Path = src.Images.AppIcon512Path
  610. },
  611. Meta = new MetaConfigDto
  612. {
  613. Keywords = src.Meta.Keywords,
  614. Description = src.Meta.Description,
  615. Author = src.Meta.Author,
  616. Viewport = src.Meta.Viewport,
  617. ApplicationName = src.Meta.ApplicationName,
  618. Generator = src.Meta.Generator,
  619. Robots = src.Meta.Robots,
  620. Adds = src.Meta.Adds
  621. },
  622. Company = new CompanyConfigDto
  623. {
  624. Name = src.Company.Name,
  625. RegNo = src.Company.RegNo,
  626. Address = src.Company.Address,
  627. ZipCode = src.Company.ZipCode,
  628. Owner = src.Company.Owner,
  629. Tel = src.Company.Tel,
  630. Fax = src.Company.Fax,
  631. RetailSaleNo = src.Company.RetailSaleNo,
  632. AddedSaleNo = src.Company.AddedSaleNo,
  633. Hosting = src.Company.Hosting,
  634. AdminName = src.Company.AdminName,
  635. AdminEmail = src.Company.AdminEmail,
  636. SiteUrl = src.Company.SiteUrl,
  637. BankCode = src.Company.BankCode,
  638. BankOwner = src.Company.BankOwner,
  639. BankNumber = src.Company.BankNumber
  640. },
  641. Account = new AccountConfigDto
  642. {
  643. IsRegisterBlock = src.Account.IsRegisterBlock,
  644. IsRegisterEmailAuth = src.Account.IsRegisterEmailAuth,
  645. PasswordMinLength = src.Account.PasswordMinLength,
  646. PasswordUppercaseLength = src.Account.PasswordUppercaseLength,
  647. PasswordNumbersLength = src.Account.PasswordNumbersLength,
  648. PasswordSpecialcharsLength = src.Account.PasswordSpecialcharsLength,
  649. DeniedEmailList = src.Account.DeniedEmailList,
  650. DeniedNameList = src.Account.DeniedNameList,
  651. ChangeEmailDay = src.Account.ChangeEmailDay,
  652. ChangeNameDay = src.Account.ChangeNameDay,
  653. ChangeSummaryDay = src.Account.ChangeSummaryDay,
  654. ChangeIntroDay = src.Account.ChangeIntroDay,
  655. ChangePasswordDay = src.Account.ChangePasswordDay,
  656. IsLoginEmailVerifiedOnly = src.Account.IsLoginEmailVerifiedOnly,
  657. MaxLoginTryCount = src.Account.MaxLoginTryCount,
  658. MaxLoginTryLimitSecond = src.Account.MaxLoginTryLimitSecond
  659. },
  660. EmailTemplate = new EmailTemplateConfigDto
  661. {
  662. RegisterEmailFormTitle = src.EmailTemplate.RegisterEmailFormTitle,
  663. RegisterEmailFormContent = src.EmailTemplate.RegisterEmailFormContent,
  664. RegistrationEmailFormTitle = src.EmailTemplate.RegistrationEmailFormTitle,
  665. RegistrationEmailFormContent = src.EmailTemplate.RegistrationEmailFormContent,
  666. ResetPasswordEmailFormTitle = src.EmailTemplate.ResetPasswordEmailFormTitle,
  667. ResetPasswordEmailFormContent = src.EmailTemplate.ResetPasswordEmailFormContent,
  668. ChangedPasswordEmailFormTitle = src.EmailTemplate.ChangedPasswordEmailFormTitle,
  669. ChangedPasswordEmailFormContent = src.EmailTemplate.ChangedPasswordEmailFormContent,
  670. WithdrawEmailFormTitle = src.EmailTemplate.WithdrawEmailFormTitle,
  671. WithdrawEmailFormContent = src.EmailTemplate.WithdrawEmailFormContent,
  672. WithdrawVerifyEmailFormTitle = src.EmailTemplate.WithdrawVerifyEmailFormTitle,
  673. WithdrawVerifyEmailFormContent = src.EmailTemplate.WithdrawVerifyEmailFormContent,
  674. EmailVerifyFormTitle = src.EmailTemplate.EmailVerifyFormTitle,
  675. EmailVerifyFormContent = src.EmailTemplate.EmailVerifyFormContent,
  676. ChangedEmailFormTitle = src.EmailTemplate.ChangedEmailFormTitle,
  677. ChangedEmailFormContent = src.EmailTemplate.ChangedEmailFormContent
  678. },
  679. External = new ExternalApiConfigDto
  680. {
  681. YouTubeApiKeyEnc = src.External.YouTubeApiKeyEnc,
  682. YouTubeApiName = src.External.YouTubeApiName,
  683. GoogleClientId = src.External.GoogleClientId,
  684. GoogleClientSecretEnc = src.External.GoogleClientSecretEnc,
  685. GoogleAppId = src.External.GoogleAppId,
  686. NaverClientId = src.External.NaverClientId,
  687. KakaoJavascriptKey = src.External.KakaoJavascriptKey,
  688. NaverSearchClientId = src.External.NaverSearchClientId
  689. // 비밀 키(Secret)는 화면에 되돌리지 않음 — 빈 값 = 기존 유지
  690. },
  691. // 토스 키는 화면에 되돌리지 않는다 (암호문 재제출로 인한 이중 암호화 방지 — 빈 값 = 기존 유지)
  692. Toss = new TossConfigDto
  693. {
  694. TossPayMode = src.Toss.TossPayMode
  695. },
  696. Attendance = new AttendanceConfigDto
  697. {
  698. IsEnabled = src.Attendance.IsEnabled,
  699. BaseExp = src.Attendance.BaseExp,
  700. BasePoint = src.Attendance.BasePoint,
  701. UseStreakBonus = src.Attendance.UseStreakBonus,
  702. StreakBonusPerDay = src.Attendance.StreakBonusPerDay,
  703. StreakBonusPointPerDay = src.Attendance.StreakBonusPointPerDay,
  704. StreakBonusMaxDays = src.Attendance.StreakBonusMaxDays,
  705. UseRankBonus = src.Attendance.UseRankBonus,
  706. RankBonusConfig = src.Attendance.RankBonusConfig
  707. },
  708. SignupReward = new SignupRewardConfigDto
  709. {
  710. Enabled = src.SignupReward.Enabled,
  711. CoinAmount = src.SignupReward.CoinAmount,
  712. CashAmount = src.SignupReward.CashAmount,
  713. ExpAmount = src.SignupReward.ExpAmount
  714. },
  715. Reward = new RewardConfigDto
  716. {
  717. PostExp = src.Reward.PostExp,
  718. PostPoint = src.Reward.PostPoint,
  719. CommentExp = src.Reward.CommentExp,
  720. CommentPoint = src.Reward.CommentPoint,
  721. LikeGivenExp = src.Reward.LikeGivenExp,
  722. LikeReceivedPoint = src.Reward.LikeReceivedPoint,
  723. MinPostLength = src.Reward.MinPostLength,
  724. MinCommentLength = src.Reward.MinCommentLength,
  725. NewMemberHoldDays = src.Reward.NewMemberHoldDays,
  726. PostDailyCount = src.Reward.PostDailyCount,
  727. PostDailyExp = src.Reward.PostDailyExp,
  728. PostDailyPoint = src.Reward.PostDailyPoint,
  729. CommentDailyCount = src.Reward.CommentDailyCount,
  730. CommentDailyExp = src.Reward.CommentDailyExp,
  731. CommentDailyPoint = src.Reward.CommentDailyPoint,
  732. LikeGivenDailyCount = src.Reward.LikeGivenDailyCount,
  733. LikeGivenDailyExp = src.Reward.LikeGivenDailyExp,
  734. LikeReceivedDailyCount = src.Reward.LikeReceivedDailyCount,
  735. LikeReceivedDailyPoint = src.Reward.LikeReceivedDailyPoint,
  736. ChatDailyCount = src.Reward.ChatDailyCount,
  737. ChatDailyExp = src.Reward.ChatDailyExp,
  738. CheerFeePercent = src.Reward.CheerFeePercent,
  739. CheerMinAmount = src.Reward.CheerMinAmount,
  740. CheerDailyMax = src.Reward.CheerDailyMax
  741. },
  742. Paper = new PaperConfigDto
  743. {
  744. Enabled = src.Paper.Enabled,
  745. FeeRateBp = src.Paper.FeeRateBp,
  746. TaxRateBp = src.Paper.TaxRateBp,
  747. MinDeposit = src.Paper.MinDeposit,
  748. MaxHolding = src.Paper.MaxHolding,
  749. WithdrawProfitBurnBp = src.Paper.WithdrawProfitBurnBp,
  750. OrderMaxPctBp = src.Paper.OrderMaxPctBp,
  751. MinFillsForRank = src.Paper.MinFillsForRank
  752. },
  753. // 키는 화면에 되돌리지 않음(빈 값=유지) — 플래그만 현재값 반영
  754. DataCollection = new DataCollectionConfigDto
  755. {
  756. StockDataMasterSync = src.DataCollection.StockDataMasterSync,
  757. StockDataDailyPriceSync = src.DataCollection.StockDataDailyPriceSync,
  758. KrxIndexSync = src.DataCollection.KrxIndexSync,
  759. KrxBondIndexSync = src.DataCollection.KrxBondIndexSync,
  760. KrxStockSync = src.DataCollection.KrxStockSync,
  761. KrxEtpSync = src.DataCollection.KrxEtpSync,
  762. KrxWarrantSync = src.DataCollection.KrxWarrantSync,
  763. KrxBondSync = src.DataCollection.KrxBondSync,
  764. KrxDerivativeSync = src.DataCollection.KrxDerivativeSync,
  765. KrxCommoditySync = src.DataCollection.KrxCommoditySync,
  766. KrxEsgSync = src.DataCollection.KrxEsgSync,
  767. OpenDartDisclosureSync = src.DataCollection.OpenDartDisclosureSync,
  768. KoreaEximMacroSync = src.DataCollection.KoreaEximMacroSync,
  769. KosisSync = src.DataCollection.KosisSync,
  770. WorldIndexEnabled = src.DataCollection.WorldIndexEnabled,
  771. MarketQuoteEnabled = src.DataCollection.MarketQuoteEnabled,
  772. SeibroIssuerSync = src.DataCollection.SeibroIssuerSync,
  773. SeibroDividendSync = src.DataCollection.SeibroDividendSync,
  774. SeibroSupplySync = src.DataCollection.SeibroSupplySync,
  775. SeibroCorpActionSync = src.DataCollection.SeibroCorpActionSync,
  776. SeibroBondSync = src.DataCollection.SeibroBondSync,
  777. SeibroDerivSync = src.DataCollection.SeibroDerivSync,
  778. SeibroForeignSync = src.DataCollection.SeibroForeignSync
  779. }
  780. };
  781. }