team-ljyzipelo

공개
817줄26 KB
1use std::{collections::BTreeSet, path::PathBuf};
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4pub enum Format {
5 Zip,
6 Tar,
7 Gzip,
8 TarGzip,
9 SevenZip,
10}
11#[derive(Clone, Debug, Eq, PartialEq)]
12pub enum SourceObject {
13 Unix { device: u64, inode: u64 },
14 Windows { volume: u64, file_id: [u8; 16] },
15}
16#[derive(Clone, Debug, Eq, PartialEq)]
17pub struct ListId {
18 pub catalog_version: u16,
19 pub format: Format,
20 pub source_object: SourceObject,
21 pub archive_bytes: u64,
22 pub archive_sha256: [u8; 32],
23}
24#[derive(Clone, Debug, Eq, PartialEq)]
25pub enum Selection {
26 All,
27 EntryIds(Vec<u32>),
28}
29#[derive(Clone, Copy, Debug, Eq, PartialEq)]
30pub enum Method {
31 Store,
32 Deflate,
33}
34#[derive(Clone, Debug, Eq, PartialEq)]
35pub enum Start {
36 List {
37 archive: PathBuf,
38 },
39 Extract {
40 archive: PathBuf,
41 destination: PathBuf,
42 selection: Selection,
43 list_id: ListId,
44 gzip_output_name: Option<String>,
45 },
46 CreateZip {
47 sources: Vec<(PathBuf, String)>,
48 output_file: PathBuf,
49 method: Method,
50 aes256: bool,
51 },
52}
53// 암호를 Debug와 로그에서 제외하고 소유 버퍼를 해제 전에 지움.
54pub struct Secret(Vec<u8>);
55impl Secret {
56 pub fn new(text: String) -> Result<Self, &'static str> {
57 let mut bytes = text.into_bytes();
58 if bytes.is_empty() || bytes.len() > 1024 {
59 bytes.fill(0);
60 return Err("암호는 UTF-8 1~1024바이트로 입력하세요");
61 }
62 Ok(Self(bytes))
63 }
64 pub fn as_bytes(&self) -> &[u8] {
65 &self.0
66 }
67}
68impl Drop for Secret {
69 fn drop(&mut self) {
70 self.0.fill(0);
71 }
72}
73pub enum Command {
74 Start(Start),
75 Password { challenge_id: u64, secret: Secret },
76 Cancel,
77}
78pub struct Request {
79 pub job_id: u64,
80 pub sequence: u64,
81 pub command: Command,
82}
83#[derive(Clone, Copy, Debug, Eq, PartialEq)]
84pub enum Kind {
85 File,
86 Directory,
87 Link,
88 Other,
89}
90#[derive(Clone, Debug, Eq, PartialEq)]
91pub struct Entry {
92 pub id: u32,
93 pub name: String,
94 pub kind: Kind,
95 pub bytes: Option<u64>,
96 pub packed: Option<u64>,
97 pub encrypted: bool,
98}
99#[derive(Clone, Copy, Debug, Eq, PartialEq)]
100pub enum CancelStatus {
101 Requested,
102 AlreadyRequested,
103 TooLate,
104 Finished,
105}
106#[derive(Clone, Copy, Debug, Eq, PartialEq)]
107pub enum Stage {
108 Scan,
109 Read,
110 Decode,
111 Write,
112 Verify,
113 Commit,
114}
115#[derive(Clone, Copy, Debug, Eq, PartialEq)]
116pub enum Outcome {
117 Completed,
118 Failed,
119 Cancelled,
120}
121#[derive(Clone, Copy, Debug, Eq, PartialEq)]
122pub enum ErrorCode {
123 Integrity,
124 UnsupportedFormat,
125 UnsupportedFeature,
126 WrongPassword,
127 UnsafePath,
128 Conflict,
129 Limit,
130 Io,
131 Protocol,
132 Internal,
133 SourceChanged,
134 InvalidRequest,
135}
136#[derive(Clone, Copy, Debug, Eq, PartialEq)]
137pub enum Publication {
138 None,
139 Partial,
140 Complete,
141 Uncertain,
142}
143#[derive(Clone, Copy, Debug, Eq, PartialEq)]
144pub enum Durability {
145 NotApplicable,
146 Synced,
147 Unconfirmed,
148 Failed,
149}
150#[derive(Clone, Copy, Debug, Eq, PartialEq)]
151pub enum Cleanup {
152 Complete,
153 Failed,
154 Unconfirmed,
155}
156#[derive(Clone, Copy, Debug, Eq, PartialEq)]
157pub enum Disposition {
158 Created,
159 PartialRetained,
160 Removed,
161 CommitUncertain,
162}
163#[derive(Clone, Debug)]
164pub struct Terminal {
165 pub outcome: Outcome,
166 pub error: Option<ErrorCode>,
167 pub publication: Publication,
168 pub created_count: u64,
169 pub retained_partial_count: u64,
170 pub durability: Durability,
171 pub cleanup: Cleanup,
172}
173#[derive(Clone, Debug)]
174pub enum Event {
175 Accepted {
176 encryption: bool,
177 },
178 Entry(Entry),
179 ListEnd {
180 entry_count: u32,
181 list_id: ListId,
182 },
183 PasswordRequired {
184 challenge_id: u64,
185 attempt: u32,
186 encrypt: bool,
187 },
188 Progress {
189 stage: Stage,
190 processed: u64,
191 total: Option<u64>,
192 completed_entries: u64,
193 },
194 Output {
195 entry_id: Option<u32>,
196 relative_name: String,
197 disposition: Disposition,
198 },
199 CancelAck {
200 request_sequence: u64,
201 status: CancelStatus,
202 },
203 Terminal(Terminal),
204}
205pub enum HostEvent {
206 Fault(String),
207 CleanupComplete,
208 Frame {
209 job_id: u64,
210 sequence: u64,
211 event: Event,
212 },
213 StdoutEof,
214 StderrEof,
215 Exited {
216 success: bool,
217 },
218}
219// 바이트 codec과 프로세스 소유는 작업자 어댑터에서 담당함.
220// 전송 실패 후에도 poll로 양쪽 EOF와 자식 회수 결과를 전달함.
221pub trait Connection {
222 fn send(&mut self, request: Request) -> Result<(), String>;
223 fn poll(&mut self) -> Option<HostEvent>;
224}
225pub trait Factory {
226 fn connect(&mut self, job_id: u64) -> Result<Box<dyn Connection>, String>;
227}
228pub struct Unavailable;
229impl Factory for Unavailable {
230 fn connect(&mut self, _: u64) -> Result<Box<dyn Connection>, String> {
231 Err("작업자 연결이 아직 준비되지 않았습니다".into())
232 }
233}
234struct Running {
235 id: u64,
236 outgoing: u64,
237 incoming: u64,
238 accepted: bool,
239 start_failed: bool,
240 start: Start,
241 connection: Box<dyn Connection>,
242 entries: Vec<Entry>,
243 list_end: Option<(u32, ListId)>,
244 stdout_eof: bool,
245 transport_closed: bool,
246 stderr_eof: bool,
247 exit: Option<bool>,
248 cancel_sequence: Option<u64>,
249}
250#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
251pub enum Close {
252 #[default]
253 Open,
254 Confirm,
255 Waiting,
256 Review,
257 Allowed,
258}
259#[derive(Default)]
260pub struct Model {
261 running: Option<Running>,
262 next_id: u64,
263 pub archive: Option<PathBuf>,
264 pub entries: Vec<Entry>,
265 pub list_id: Option<ListId>,
266 pub selected: BTreeSet<u32>,
267 pub terminal: Option<Terminal>,
268 pub challenge: Option<(u64, u32, bool)>,
269 pub progress: Option<(Stage, u64, Option<u64>, u64)>,
270 pub outputs: Vec<(String, Disposition)>,
271 pub cancel: Option<CancelStatus>,
272 pub error: Option<String>,
273 pub input_error: Option<String>,
274 pub encryption: bool,
275 pub close: Close,
276 pub confirmed: bool,
277}
278impl Model {
279 pub fn busy(&self) -> bool {
280 self.running.is_some()
281 }
282 pub fn job_id(&self) -> Option<u64> {
283 self.running.as_ref().map(|r| r.id)
284 }
285 pub fn can_extract(&self) -> bool {
286 !self.busy()
287 && self.list_id.is_some()
288 && self.archive.is_some()
289 && self.close == Close::Open
290 }
291 pub fn begin(&mut self, start: Start, factory: &mut dyn Factory) -> bool {
292 if self.busy() || self.close != Close::Open {
293 return false;
294 }
295 let validation = match &start {
296 Start::List { archive } => archive.is_absolute(),
297 Start::Extract {
298 archive,
299 destination,
300 selection,
301 gzip_output_name,
302 list_id,
303 } => {
304 archive.is_absolute()
305 && destination.is_absolute()
306 && self.archive.as_ref() == Some(archive)
307 && self.list_id.as_ref() == Some(list_id)
308 && match list_id.format {
309 Format::Gzip => gzip_output_name.as_ref().is_some_and(|s| valid_leaf(s)),
310 _ => gzip_output_name.is_none(),
311 }
312 && match selection {
313 Selection::All => true,
314 Selection::EntryIds(ids) => {
315 !ids.is_empty()
316 && ids.iter().collect::<BTreeSet<_>>().len() == ids.len()
317 && ids.iter().all(|id| {
318 self.entries.iter().any(|e| {
319 e.id == *id
320 && matches!(e.kind, Kind::File | Kind::Directory)
321 })
322 })
323 }
324 }
325 }
326 Start::CreateZip {
327 sources,
328 output_file,
329 ..
330 } => {
331 !sources.is_empty()
332 && output_file.is_absolute()
333 && sources
334 .iter()
335 .all(|(p, n)| p.is_absolute() && valid_relative(n))
336 }
337 };
338 if !validation {
339 self.input_error = Some("입력 경로, 출력명과 선택한 목록을 확인하세요".into());
340 return false;
341 }
342 let Some(id) = self.next_id.checked_add(1) else {
343 self.error = Some("작업 ID 한도에 도달했습니다".into());
344 return false;
345 };
346 let mut connection = match factory.connect(id) {
347 Ok(c) => c,
348 Err(e) => {
349 self.error = Some(e);
350 return false;
351 }
352 };
353 let send_error = connection
354 .send(Request {
355 job_id: id,
356 sequence: 0,
357 command: Command::Start(start.clone()),
358 })
359 .err();
360 let started = send_error.is_none();
361 if let Start::List { archive } = &start
362 && started
363 {
364 self.archive = Some(archive.clone());
365 self.list_id = None;
366 self.entries.clear();
367 self.selected.clear();
368 }
369 self.next_id = id;
370 self.terminal = None;
371 self.challenge = None;
372 self.progress = None;
373 self.outputs.clear();
374 self.cancel = None;
375 self.input_error = None;
376 self.error = send_error;
377 self.confirmed = false;
378 self.running = Some(Running {
379 id,
380 outgoing: 1,
381 incoming: 0,
382 accepted: false,
383 start_failed: !started,
384 start,
385 connection,
386 entries: Vec::new(),
387 list_end: None,
388 stdout_eof: false,
389 transport_closed: false,
390 stderr_eof: false,
391 exit: None,
392 cancel_sequence: None,
393 });
394 started
395 }
396 pub fn extract(
397 &mut self,
398 destination: PathBuf,
399 selected_only: bool,
400 gzip_output_name: Option<String>,
401 factory: &mut dyn Factory,
402 ) -> bool {
403 if !self.can_extract() {
404 return false;
405 }
406 self.begin(
407 Start::Extract {
408 archive: self.archive.clone().unwrap(),
409 destination,
410 selection: if selected_only {
411 Selection::EntryIds(self.selected.iter().copied().collect())
412 } else {
413 Selection::All
414 },
415 list_id: self.list_id.clone().unwrap(),
416 gzip_output_name,
417 },
418 factory,
419 )
420 }
421 pub fn password(&mut self, text: String) -> bool {
422 let Some((challenge_id, _, _)) = self.challenge else {
423 return false;
424 };
425 let secret = match Secret::new(text) {
426 Ok(s) => s,
427 Err(e) => {
428 self.input_error = Some(e.into());
429 return false;
430 }
431 };
432 if self
433 .send(Command::Password {
434 challenge_id,
435 secret,
436 })
437 .is_some()
438 {
439 self.challenge = None;
440 self.input_error = None;
441 true
442 } else {
443 false
444 }
445 }
446 fn send(&mut self, command: Command) -> Option<u64> {
447 let run = self.running.as_mut()?;
448 if run.start_failed || self.terminal.is_some() || run.exit.is_some() {
449 return None;
450 }
451 let seq = run.outgoing;
452 let Some(next) = seq.checked_add(1) else {
453 self.error = Some("요청 순서 한도 초과".into());
454 return None;
455 };
456 match run.connection.send(Request {
457 job_id: run.id,
458 sequence: seq,
459 command,
460 }) {
461 Ok(()) => {
462 run.outgoing = next;
463 Some(seq)
464 }
465 Err(e) => {
466 self.error = Some(e);
467 None
468 }
469 }
470 }
471 pub fn cancel(&mut self) {
472 if self
473 .running
474 .as_ref()
475 .is_some_and(|r| r.cancel_sequence.is_none())
476 {
477 if let Some(seq) = self.send(Command::Cancel) {
478 self.running.as_mut().unwrap().cancel_sequence = Some(seq);
479 self.challenge = None;
480 self.input_error = None;
481 }
482 }
483 }
484 pub fn request_close(&mut self) {
485 if self.close == Close::Open {
486 self.close = if self.busy() {
487 Close::Confirm
488 } else {
489 Close::Review
490 };
491 }
492 }
493 pub fn confirm_close(&mut self) {
494 if self.close == Close::Confirm {
495 self.cancel();
496 self.close = if self.busy() {
497 Close::Waiting
498 } else {
499 Close::Review
500 };
501 }
502 }
503 pub fn keep_open(&mut self) {
504 if self.close != Close::Allowed {
505 self.close = Close::Open;
506 }
507 }
508 pub fn acknowledge_close(&mut self) {
509 if !self.busy() && self.close == Close::Review {
510 self.close = Close::Allowed;
511 }
512 }
513 pub fn poll(&mut self) {
514 for _ in 0..128 {
515 let Some(event) = self.running.as_mut().and_then(|r| r.connection.poll()) else {
516 break;
517 };
518 self.receive(event);
519 }
520 let complete = self.running.as_ref().is_some_and(|r| {
521 r.exit.is_some()
522 && ((r.stdout_eof && r.stderr_eof) || (r.transport_closed && self.error.is_some()))
523 });
524 if complete {
525 let run = self.running.take().unwrap();
526 self.confirmed =
527 self.terminal.is_some() && run.exit == Some(true) && self.error.is_none();
528 if !self.confirmed {
529 self.error.get_or_insert(
530 "작업자 종료 결과를 확인할 수 없습니다. 출력 상태를 확인하세요".into(),
531 );
532 }
533 if self.confirmed
534 && self
535 .terminal
536 .as_ref()
537 .is_some_and(|t| t.outcome == Outcome::Completed)
538 {
539 if matches!(run.start, Start::List { .. }) {
540 if let Some((count, id)) = run
541 .list_end
542 .filter(|(n, _)| *n as usize == run.entries.len())
543 {
544 let _ = count;
545 self.entries = run.entries;
546 self.list_id = Some(id);
547 } else {
548 self.error = Some("목록 완료 정보가 일치하지 않습니다. 다시 여세요".into());
549 self.confirmed = false;
550 }
551 }
552 }
553 if self
554 .terminal
555 .as_ref()
556 .is_some_and(|t| t.error == Some(ErrorCode::SourceChanged))
557 {
558 self.list_id = None;
559 self.selected.clear();
560 }
561 self.challenge = None;
562 self.input_error = None;
563 if matches!(self.close, Close::Waiting | Close::Confirm) {
564 self.close = Close::Review;
565 }
566 }
567 }
568 fn receive(&mut self, host: HostEvent) {
569 let run = self.running.as_mut().unwrap();
570 match host {
571 HostEvent::Fault(message) => self.error = Some(message),
572 HostEvent::CleanupComplete => run.transport_closed = true,
573 HostEvent::StdoutEof => run.stdout_eof = true,
574 HostEvent::StderrEof => run.stderr_eof = true,
575 HostEvent::Exited { success } => run.exit = Some(success),
576 HostEvent::Frame {
577 job_id,
578 sequence,
579 event,
580 } => {
581 if job_id != run.id
582 || sequence != run.incoming
583 || self.terminal.is_some()
584 || run.stdout_eof
585 || sequence >= 1_000_000
586 {
587 self.error = Some("작업자 응답 순서나 작업 ID가 일치하지 않습니다".into());
588 return;
589 }
590 run.incoming += 1;
591 if !run.accepted && !matches!(event, Event::Accepted { .. }) {
592 self.error = Some("작업 승인 응답이 없습니다".into());
593 return;
594 }
595 match event {
596 Event::Accepted { encryption } => {
597 if run.accepted {
598 self.error = Some("작업 승인 중복".into());
599 }
600 run.accepted = true;
601 self.encryption = encryption;
602 }
603 Event::Entry(entry) => {
604 if !matches!(run.start, Start::List { .. })
605 || run.list_end.is_some()
606 || entry.id as usize != run.entries.len()
607 || entry.name.len() > 4096
608 || run.entries.len() >= 100_000
609 {
610 self.error = Some("목록 응답이 유효하지 않습니다".into());
611 } else {
612 run.entries.push(entry);
613 }
614 }
615 Event::ListEnd {
616 entry_count,
617 list_id,
618 } => {
619 if !matches!(run.start, Start::List { .. })
620 || run.list_end.is_some()
621 || list_id.catalog_version != 1
622 {
623 self.error = Some("목록 완료 응답이 유효하지 않습니다".into());
624 } else {
625 run.list_end = Some((entry_count, list_id));
626 }
627 }
628 Event::PasswordRequired {
629 challenge_id,
630 attempt,
631 encrypt,
632 } => {
633 if self.challenge.is_some() || challenge_id == 0 {
634 self.error = Some("암호 요청이 유효하지 않습니다".into());
635 } else {
636 self.challenge = Some((challenge_id, attempt, encrypt));
637 }
638 }
639 Event::Progress {
640 stage,
641 processed,
642 total,
643 completed_entries,
644 } => self.progress = Some((stage, processed, total, completed_entries)),
645 Event::Output {
646 relative_name,
647 disposition,
648 ..
649 } => {
650 if self.outputs.len() < 100_000 && relative_name.len() <= 4096 {
651 self.outputs.push((relative_name, disposition));
652 } else {
653 self.error = Some("출력 보고 한도 초과".into());
654 }
655 }
656 Event::CancelAck {
657 request_sequence,
658 status,
659 } => {
660 if run.cancel_sequence == Some(request_sequence) && self.cancel.is_none() {
661 self.cancel = Some(status);
662 } else {
663 self.error = Some("취소 응답이 요청과 일치하지 않습니다".into());
664 }
665 }
666 Event::Terminal(t) => {
667 self.challenge = None;
668 self.terminal = Some(t);
669 }
670 }
671 }
672 }
673 }
674 pub fn status(&self) -> String {
675 if let Some(error) = self.error.as_ref().or(self.input_error.as_ref()) {
676 return error.clone();
677 }
678 if self.busy() {
679 if self.terminal.is_some() {
680 return "작업 결과 수신 / 프로세스 종료 확인 중".into();
681 }
682 if self.challenge.is_some() {
683 return "암호를 입력하세요".into();
684 }
685 if let Some(c) = self.cancel {
686 return match c {
687 CancelStatus::Requested | CancelStatus::AlreadyRequested => {
688 "취소 요청 접수 / 최종 결과 대기"
689 }
690 CancelStatus::TooLate => "취소할 수 없는 단계 / 최종 결과 대기",
691 CancelStatus::Finished => "처리 종료 응답 / 프로세스 종료 확인 중",
692 }
693 .into();
694 }
695 if self
696 .running
697 .as_ref()
698 .is_some_and(|r| r.cancel_sequence.is_some())
699 {
700 return "취소 요청 전송 / 최종 결과 대기".into();
701 }
702 return "작업 중".into();
703 }
704 match self
705 .terminal
706 .as_ref()
707 .filter(|_| self.confirmed)
708 .map(|t| t.outcome)
709 {
710 Some(Outcome::Completed) => "작업 완료",
711 Some(Outcome::Cancelled) => "작업 취소됨",
712 Some(Outcome::Failed) => "작업 실패",
713 None => "압축파일을 열거나 ZIP 파일을 만드세요",
714 }
715 .into()
716 }
717}
718pub fn valid_leaf(name: &str) -> bool {
719 valid_relative(name) && !name.contains('/') && !name.contains('\\')
720}
721pub fn valid_relative(name: &str) -> bool {
722 !name.is_empty()
723 && !name.contains('\0')
724 && !name.contains(':')
725 && !name.starts_with('/')
726 && !name.starts_with('\\')
727 && name
728 .split(['/', '\\'])
729 .all(|p| !p.is_empty() && p != "." && p != "..")
730}
731
732// 파일 연결로 전달된 원형 경로를 손실 변환 없이 보존함.
733pub fn launch_args(
734 args: Vec<std::ffi::OsString>,
735 cwd: PathBuf,
736) -> Result<(bool, Option<PathBuf>), &'static str> {
737 let fixture = args.iter().any(|arg| arg == "--ui-fixture");
738 let paths = args
739 .into_iter()
740 .filter(|arg| arg != "--ui-fixture")
741 .collect::<Vec<_>>();
742 if paths.len() > 1 {
743 return Err("압축파일 하나를 지정하세요");
744 }
745 let path = paths
746 .into_iter()
747 .next()
748 .map(PathBuf::from)
749 .map(|p| if p.is_absolute() { p } else { cwd.join(p) });
750 Ok((fixture, path))
751}
752
753pub fn stage_label(stage: Stage) -> &'static str {
754 match stage {
755 Stage::Scan => "목록 읽는 중",
756 Stage::Read => "파일 읽는 중",
757 Stage::Decode => "압축 푸는 중",
758 Stage::Write => "파일 쓰는 중",
759 Stage::Verify => "검증 중",
760 Stage::Commit => "저장 마무리 중",
761 }
762}
763pub fn disposition_label(disposition: Disposition) -> &'static str {
764 match disposition {
765 Disposition::Created => "생성됨",
766 Disposition::PartialRetained => "일부 파일 남음",
767 Disposition::Removed => "작업 임시 파일 정리됨",
768 Disposition::CommitUncertain => "저장 여부 불확실",
769 }
770}
771pub fn terminal_lines(t: &Terminal) -> Vec<String> {
772 let publication = match t.publication {
773 Publication::None => "게시된 파일 없음",
774 Publication::Partial => "일부 파일 게시됨",
775 Publication::Complete => "파일 게시 완료",
776 Publication::Uncertain => "파일 게시 여부 불확실 / 출력 폴더를 확인하세요",
777 };
778 let durability = match t.durability {
779 Durability::NotApplicable => "동기화 해당 없음",
780 Durability::Synced => "디스크 동기화 완료",
781 Durability::Unconfirmed => "디스크 동기화 미확인",
782 Durability::Failed => "디스크 동기화 실패",
783 };
784 let cleanup = match t.cleanup {
785 Cleanup::Complete => "작업 임시 파일 정리 완료",
786 Cleanup::Failed => "작업 임시 파일 정리 실패",
787 Cleanup::Unconfirmed => "작업 임시 파일 정리 미확인",
788 };
789 let mut lines = vec![
790 publication.into(),
791 format!(
792 "생성 {}개 / 남은 임시 파일 {}개",
793 t.created_count, t.retained_partial_count
794 ),
795 format!("{durability} / {cleanup}"),
796 ];
797 if let Some(error) = t.error {
798 lines.push(
799 match error {
800 ErrorCode::Integrity => "압축파일이 손상됐습니다",
801 ErrorCode::UnsupportedFormat => "지원하지 않는 압축 형식입니다",
802 ErrorCode::UnsupportedFeature => "아직 지원하지 않는 기능입니다",
803 ErrorCode::WrongPassword => "암호가 올바르지 않습니다",
804 ErrorCode::UnsafePath => "안전하지 않은 경로가 있어 중단했습니다",
805 ErrorCode::Conflict => "같은 이름의 파일이 있습니다. 다른 출력 폴더를 선택하세요",
806 ErrorCode::Limit => "처리 한도를 초과했습니다",
807 ErrorCode::Io => "파일을 읽거나 쓰지 못했습니다",
808 ErrorCode::Protocol => "작업자 응답이 올바르지 않습니다",
809 ErrorCode::Internal => "작업자 처리 오류입니다",
810 ErrorCode::SourceChanged => "원본 파일이 바뀌었습니다. 압축파일을 다시 여세요",
811 ErrorCode::InvalidRequest => "입력과 선택한 항목을 확인하세요",
812 }
813 .into(),
814 );
815 }
816 lines
817}