Skip to content
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

feat: 배너 탭 연결 #112

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Features/MOITList/MOITListData/Interface/DTO/BannerDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public struct AttendanceBannerDTO: Decodable {
let moitId: Int
let moitName: String
let studyId: Int
let studyStartAt: Date
let studyLateAt: Date
let studyAbsenceAt: Date
let studyStartAt: String
let studyLateAt: String
let studyAbsenceAt: String

public func toBanner() -> Banner {
Banner.attendence(
Expand Down
16 changes: 8 additions & 8 deletions Features/MOITList/MOITListDomain/Interface/Model/Banner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ public struct AttendenceBanner {
moitId: Int,
moitName: String,
studyId: Int,
studyStartAt: Date,
studyLateAt: Date,
studyAbsenceAt: Date
studyStartAt: String,
studyLateAt: String,
studyAbsenceAt: String
) {
self.userId = userId
self.moitId = moitId
self.moitName = moitName
self.studyId = studyId
self.studyStartAt = studyStartAt
self.studyLateAt = studyLateAt
self.studyAbsenceAt = studyAbsenceAt
self.studyStartAt = studyStartAt.toDate()
self.studyLateAt = studyLateAt.toDate()
self.studyAbsenceAt = studyAbsenceAt.toDate()
}
}

extension String {
func toDate() -> Date {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
return dateFormatter.date(from: self)!
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:s"
return dateFormatter.date(from: self) ?? Date()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,15 @@ final class MOITListInteractor: PresentableInteractor<MOITListPresentable>, MOIT
.withLatestFrom(bannerList) { index, bannerInfos in
bannerInfos[index]
}
.subscribe(onNext: { bannerInfo in
.subscribe(onNext: { [weak self] bannerInfo in
// TODO: - alarm 타입에 따라서 벌금, 출첵으로 나눠서 보내기
print("bannerInfo: \(bannerInfo)")
switch bannerInfo {
case .fine(let banner):
// 화면 전환
fatalError("화면 전환")
self?.router?.attachMOITDetail(id: "\(banner.moitId)")
case .attendence(let banner):
// 화면 전환
fatalError("화면 전환")
self?.router?.attachMOITAttendance(id: "\(banner.moitId)")
case .empty:
return
}
Expand Down
Loading