Repository navigation
클래스 이용권 동선과 AI 상태 매핑 정리 #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ struct ClassPersonalReportDTO: Decodable, Sendable { | |
|
|
||
| } | ||
|
|
||
| let state: String | ||
| let state: ClassAIGenerationState | ||
| let feedback: Feedback? | ||
| let preOption: VoteOption? | ||
| let postOption: VoteOption? | ||
|
|
@@ -52,7 +52,7 @@ struct ClassInsightDTO: Decodable, Sendable { | |
|
|
||
| } | ||
|
|
||
| let state: String | ||
| let state: ClassAIGenerationState | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [P2] Major
|
||
| let retryable: Bool | ||
| let insightText: String? | ||
| let evidence: [Evidence]? | ||
|
|
@@ -62,5 +62,5 @@ struct ClassInsightDTO: Decodable, Sendable { | |
| } | ||
|
|
||
| struct ClassInsightRetryDTO: Decodable, Sendable { | ||
| let state: String | ||
| let state: ClassAIGenerationState | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [P2] Major
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import Foundation | ||
|
|
||
| enum ClassAIGenerationState: Decodable, Equatable, Sendable { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [P2] Major
|
||
| case beforeClose | ||
| case pending | ||
| case generating | ||
| case succeeded | ||
| case limited | ||
| case notEligible | ||
| case failed | ||
| case unknown | ||
|
|
||
| init(from decoder: Decoder) throws { | ||
| let value = try decoder.singleValueContainer().decode(String.self) | ||
| switch value { | ||
| case "BEFORE_CLOSE": self = .beforeClose | ||
| case "PENDING": self = .pending | ||
| case "GENERATING": self = .generating | ||
| case "SUCCEEDED": self = .succeeded | ||
| case "LIMITED": self = .limited | ||
| case "NOT_ELIGIBLE": self = .notEligible | ||
| case "FAILED": self = .failed | ||
| default: self = .unknown | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -46,7 +46,7 @@ extension ClassRepositoryImpl { | |||||||||||||||||
| public func retryInsight(roomID: Int) async throws { | ||||||||||||||||||
| do { | ||||||||||||||||||
| let payload = try await client.send(ClassResultService.retryInsight(roomID), as: ClassInsightRetryDTO.self) | ||||||||||||||||||
| guard payload.state == "PENDING" else { throw ClassAIFeedbackError.generationFailed } | ||||||||||||||||||
| guard payload.state == .pending else { throw ClassAIFeedbackError.generationFailed } | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [P2] Major
Suggested change
|
||||||||||||||||||
| } catch { | ||||||||||||||||||
| throw Self.feedbackError(error) | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 [P2] Major
ClassAIFeedbackDTO및 해당 DTO에서 사용되는ClassAIGenerationState가Domain모듈에 위치하는 것은 클린 아키텍처의 계층 의존성 규칙(Presentation → Domain ← Data)을 위반합니다.Domain레이어는 데이터 전송 객체(DTO)를 직접 알아서는 안 되며, DTO와 DTO를 위한 타입 정의는Data레이어에 속해야 합니다.