generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ :: [#398] LectureDomain / 강의 이수중인 학생 상세조회 기능 추가
- Loading branch information
Showing
12 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Foundation | ||
|
||
public enum CompleteStatusType: String, Decodable { | ||
case notCompletedYet = "NOT_COMPLETED_YET" | ||
case completedIn3RD = "COMPLETED_IN_3RD" | ||
case completedIn2RD = "COMPLETED_IN_2RD" | ||
case completedIn1RD = "COMPLETED_IN_1RD" | ||
} | ||
|
||
extension CompleteStatusType { | ||
func display() -> String { | ||
switch self { | ||
case .notCompletedYet: return "아직 이수하지 않음" | ||
case .completedIn3RD: return "이수 완료(3학년)" | ||
case .completedIn2RD: return "이수 완료(2학년)" | ||
case .completedIn1RD: return "이수 완료(1학년)" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Service/Sources/Data/UseCase/Lecture/FetchAppliedLectureStudentDetailUseCaseImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Foundation | ||
|
||
public struct FetchAppliedLectureStudentDetailUseCaseImpl: FetchAppliedLectureStudentDetailUseCase { | ||
private let lectureRepository: any LectureRepository | ||
|
||
public init(lectureRepository: any LectureRepository) { | ||
self.lectureRepository = lectureRepository | ||
} | ||
|
||
public func callAsFunction(lectureID: String, studentID: String) async throws -> AppliedLectureStudentDetailEntity { | ||
try await lectureRepository.fetchAppliedLectureStudentDetail(lectureID: lectureID, studentID: studentID) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ce/Sources/Domain/LectureDomain/DTO/Response/AppliedLectureStudentDetailResponseDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Foundation | ||
|
||
struct AppliedLectureStudentDetailResponseDTO: Decodable { | ||
public let email: String | ||
public let name: String | ||
public let grade: Int | ||
public let classNumber: Int | ||
public let number: Int | ||
public let phoneNumber: String | ||
public let school: String | ||
public let clubName: String | ||
public let cohort: Int | ||
public let currentCompletedDate: Date | ||
public let completeStatus: CompleteStatusType | ||
} | ||
|
||
extension AppliedLectureStudentDetailResponseDTO { | ||
func toDomain() -> AppliedLectureStudentDetailEntity { | ||
AppliedLectureStudentDetailEntity( | ||
email: email, | ||
name: name, | ||
grade: grade, | ||
classNumber: classNumber, | ||
number: number, | ||
phoneNumber: phoneNumber, | ||
school: school, | ||
clubName: clubName, | ||
cohort: cohort, | ||
currentCompletedDate: currentCompletedDate, | ||
completeStatus: completeStatus | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Service/Sources/Domain/LectureDomain/Entity/AppliedLectureStudentDetailEntity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Foundation | ||
|
||
public struct AppliedLectureStudentDetailEntity: Equatable { | ||
public let email: String | ||
public let name: String | ||
public let grade: Int | ||
public let classNumber: Int | ||
public let number: Int | ||
public let phoneNumber: String | ||
public let school: String | ||
public let clubName: String | ||
public let cohort: Int | ||
public let currentCompletedDate: Date | ||
public let completeStatus: CompleteStatusType | ||
|
||
public init( | ||
email: String, | ||
name: String, | ||
grade: Int, | ||
classNumber: Int, | ||
number: Int, | ||
phoneNumber: String, | ||
school: String, | ||
clubName: String, | ||
cohort: Int, | ||
currentCompletedDate: Date, | ||
completeStatus: CompleteStatusType | ||
) { | ||
self.email = email | ||
self.name = name | ||
self.grade = grade | ||
self.classNumber = classNumber | ||
self.number = number | ||
self.phoneNumber = phoneNumber | ||
self.school = school | ||
self.clubName = clubName | ||
self.cohort = cohort | ||
self.currentCompletedDate = currentCompletedDate | ||
self.completeStatus = completeStatus | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Service/Sources/Domain/LectureDomain/UseCase/FetchAppliedLectureStudentDetailUseCase.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Foundation | ||
|
||
public protocol FetchAppliedLectureStudentDetailUseCase { | ||
func callAsFunction(lectureID: String, studentID: String) async throws -> AppliedLectureStudentDetailEntity | ||
} |