-
Notifications
You must be signed in to change notification settings - Fork 2
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
π :: (#275) λ° λ³ μ·¨μ νν© API μ°λ #276
base: develop
Are you sure you want to change the base?
Conversation
All File Checked β
|
Projects/Presentation/Sources/Home/EmployStatus/EmployStatusViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Presentation/Sources/Home/EmployStatus/ClassEmploymentViewController.swift
Outdated
Show resolved
Hide resolved
All File Checked β
|
All File Checked β
|
Projects/Presentation/Sources/Home/EmployStatus/Components/ClassTitle.swift
Outdated
Show resolved
Hide resolved
let classInfo = input.viewWillAppear | ||
.flatMapLatest { [fetchEmploymentStatusUseCase] in | ||
fetchEmploymentStatusUseCase.execute() | ||
} | ||
.map { applications in | ||
applications.first { $0.classId == self.classNumber } ?? ApplicationEntity( | ||
applicationID: 0, | ||
recruitmentID: 0, | ||
company: "", | ||
companyLogoUrl: "", | ||
attachments: [], | ||
applicationStatus: .approved, | ||
classId: self.classNumber, | ||
employmentRateResponseList: [], | ||
totalStudents: 0, | ||
passedStudents: 0 | ||
) | ||
} | ||
.share(replay: 1) |
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.
@leejh08 share(replay: 1)λ₯Ό μ¬μ©ν΄ μ²λ¦¬ν μ΄μ κ° μμκΉμ?
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.
classinfoλ₯Ό ꡬλ ν λ μ€λ³΅ μμ²μ΄ μκΈΈκ±°κ°μ μ¨λ΄€μ΅λλ€
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.
share μ μ¬λ¬κ³³μμ subscribeμ νμκ²½μ° μ¬λ¬ μ€νΈλ¦Όμ΄ μ겨 μ€λ³΅ νΈμΆλ λ λ¨μΌ μ€νΈλ¦ΌμΌλ‘ λ§λ€μ΄ μ£ΌκΈ° μν΄ μ¬μ©ν©λλ€.
νμ§λ§ νμ¬ μ½λ μμΌλ‘λ ViewControllerμ bind λΆλΆμμ outputλ₯Ό subscribeλ₯Ό νμ¬ μ€λ³΅ μ€νΈλ¦Όμ΄ μκΈ°μ§ μμ κ²μΌλ‘ 보μ
λλ€.
μ¨λ΄€λ€λ³΄λ€λ μ΄ μ΄μ κ° λͺ
νν΄μΌ νλ€κ³ μκ°ν©λλ€.
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.
κ·Έλλ μ€λ³΅νΈμΆμ μκ°νκ³ shareλ‘ λ―Έλ¦¬ λ°©μ§ νλ건 μ’μκ±° κ°μμππΏ
All File Checked β
|
All File Checked β
|
Projects/Data/Sources/DTO/Applications/ClassEmploymentListResponseDTO.swift
Outdated
Show resolved
Hide resolved
Projects/Data/Sources/DTO/Applications/ClassEmploymentListResponseDTO.swift
Outdated
Show resolved
Hide resolved
Projects/Data/Sources/DTO/Applications/ClassEmploymentListResponseDTO.swift
Outdated
Show resolved
Hide resolved
Projects/Domain/Sources/Entities/Applications/ApplicationEntity.swift
Outdated
Show resolved
Hide resolved
Projects/Presentation/Sources/Home/EmployStatus/ClassEmploymentViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Presentation/Sources/Home/EmployStatus/ClassEmploymentViewController.swift
Outdated
Show resolved
Hide resolved
.map { applications in | ||
applications.first { $0.classId == self.classNumber } ?? ApplicationEntity( | ||
applicationID: 0, | ||
recruitmentID: 0, | ||
company: "", | ||
companyLogoUrl: "", | ||
attachments: [], | ||
applicationStatus: .approved, | ||
classId: self.classNumber, | ||
employmentRateResponseList: [], | ||
totalStudents: 0, | ||
passedStudents: 0 | ||
) | ||
} |
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.
리뷰 λ¨κ²¨λλ¦° λ΄μ© ν λλ‘ ApplicationEntity μμ λ° μΆκ° νμλ©΄ κ°μ μ΄ νμν λΆλΆ κ°μ΅λλ€.
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.
μ½λκ° λ무 μ§μ λΆν κ±° κ°μμ μ€λ³΅μμ μ΄ λ§μμ
Projects/Presentation/Sources/Home/EmployStatus/EmployStatusViewController.swift
Outdated
Show resolved
Hide resolved
.forEach { classNumber, button in | ||
button.rx.tap | ||
.map { classNumber + 1 } | ||
.bind(to: classButtonTapped) | ||
.disposed(by: disposeBag) | ||
} |
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.
classNumberκ° μλλΌ indexλΌκ³ νλκ² λ§λ κ² κ°μ΅λλ€
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.
μλλ©΄ κ΅³μ΄ enumerated()λ₯Ό μ°μ§ λ§κ³ foreachμμ buttonμ μ κ·Ό ν μ μλλ°
ClassButtonμ μμλ₯Ό λ§λ€μ΄ classNumberλ₯Ό κ°μ Έμ¬ μ μκ² νλ©΄ μ’μ κ² κ°μμ
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.
μλλ©΄ κ΅³μ΄ enumerated()λ₯Ό μ°μ§ λ§κ³ foreachμμ buttonμ μ κ·Ό ν μ μλλ° ClassButtonμ μμλ₯Ό λ§λ€μ΄ classNumberλ₯Ό κ°μ Έμ¬ μ μκ² νλ©΄ μ’μ κ² κ°μμ
μ λ°°λμ΄ λ§μνμ λ°©μμΌλ‘ μ²μ μ½λλ₯Ό μμ±νμλλ° μ£Όμ μ λ°°λμ΄ μΆμ²νλ λ°©μμΌλ‘ λ°κΎΌκ² μ΄ μ½λμ
λλ€
νΉμ μ΄λ€ λ°©μμ΄ μ‘°κΈ λ ν¨μ¨μ μΌκΉμ?
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.
μ μμ°ν λ€λ₯Έ μ½λλΌκ³ μκ°ν΄μ. κΈ°μ‘΄μ ννλ‘ λ§€νν΄λ ꡬ문μ enumerate
λ₯Ό μ¬μ©ν΄ λ κΉλν μ½λλ₯Ό μ μνμ΄μ
μ λ Projects/Presentation/Sources/Home/EmployStatus/Components/ClassButton.swift #line=25
μ initμΌλ‘ μ΄λ―Έ classNumberλ₯Ό λ°κ³ μμΌλ μμλ‘ classNumberμ νλ κ°κ³ , μμΌλ©΄
.forEach { classNumber, button in | |
button.rx.tap | |
.map { classNumber + 1 } | |
.bind(to: classButtonTapped) | |
.disposed(by: disposeBag) | |
} | |
.forEach { button in | |
button.rx.tap | |
.map { button.classNumber } | |
.bind(to: classButtonTapped) | |
.disposed(by: disposeBag) | |
} |
μ΄λ°μμΌλ‘ κ΅³μ΄ index(offset)μ μ¬μ©νμ§ μκ³ λ νμ©ν μ μμ΄μ. μ΄κ²λ κ°λ μ± μ°¨μμμ μ½κ° μ견μ λΈ κ±° λΏμ΄κΈ΄ νλ λκ° λ λμμ§λ κ°μΈμ΄ νλ¨ν΄λ³΄μΈμ!
μΆκ°λ‘ tagλ₯Ό μ¨μ mapping νλΌλκ±°λλ κ±°μ λΉμ·ν λ΄μ©μ λλ€~ νλ² μκ°ν΄λ΄μ!
All File Checked β
|
Projects/Presentation/Sources/Home/EmployStatus/ClassEmploymentViewController.swift
Outdated
Show resolved
Hide resolved
All File Checked β
|
All File Checked β
|
All File Checked β
|
All File Checked β
|
All File Checked β
|
All File Checked β
|
All File Checked β
|
private func updateCompanyList(_ info: EmploymentEntity) { | ||
let allCompanies = info.employmentRateResponseList + Array( | ||
repeating: EmploymentCompany.empty, | ||
count: max(0, 16 - info.employmentRateResponseList.count) |
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.
μ견μ λλ€λ§μ, emptyλ₯Ό μ κ° νμ©ν΄λ³΄λΌ νμ§λ§.. κ·Έκ²λ λλ―Έ λ°μ΄ν°λκΉ κ·Έλ₯ nilμ λ£λ λ°©λ²λ μλ€λκ±° μμλλ©΄ μ’μμ~
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.
μ λ°°λκ»μ λ¨κ²¨μ£Όμ μκ²¬μ΄ λ μ’μ μ½λλΌκ³ μκ°λμ΄, nilμ νμ©νμ¬ μμ ν΄λ³΄μμ΅λλ€! π
public func with(classID: Int) -> EmploymentEntity { | ||
EmploymentEntity( | ||
classID: classID, | ||
employmentRateResponseList: self.employmentRateResponseList, | ||
totalStudents: self.totalStudents, | ||
passedStudents: self.passedStudents | ||
) | ||
} |
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.
μ΄λμ νμ©λλκ±ΈκΉμ?
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.
λ¨Όμ ClassEmploymentViewModelμμ with λ©μλλ₯Ό νμ©νμμ΅λλ€.
employments.first { $0.classID == classNumber } ?? EmploymentEntity.empty.with(classID: classNumber)
μΆκ°μ μΌλ‘ μ€λͺ
λ리μλ©΄
λͺ¨λ λ°μ μ·¨μ
apiλ₯Ό κ°μ Έμ¨ ν μ 보λ₯Ό λ³΄λ €λ λ°μ λ°μ΄ν°λ₯Ό μ°Ύμ΅λλ€.
λ§μ½ μλ€λ©΄ empty κ°μ²΄λ₯Ό μμ±νκ³ classIDλ§ ν΄λΉ λ° λ²νΈλ‘ λ³κ²½νμ¬ λ°νν©λλ€.
μ΄λ λ°μ΄ν°κ° μλ κ²½μ°μλ ν΄λΉ λ°μ λΉ μ 보λ₯Ό νμνκΈ° μνμ¬ μμ
νμ΅λλ€
All File Checked β
|
All File Checked β
|
κ°μ
μμ μ¬ν
UI