Skip to content

Commit

Permalink
[Feat] sopt-makers#199 - 출석하기 Network 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
0inn committed Apr 22, 2023
1 parent 556c05f commit b303633
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation
import Combine

import Core
import Alamofire
import Moya

Expand All @@ -18,24 +19,24 @@ public protocol AttendanceService {
func fetchAttendanceSchedule() -> AnyPublisher<BaseEntity<AttendanceScheduleEntity>, Error>
func fetchAttendanceScore() -> AnyPublisher<BaseEntity<AttendanceScoreEntity>, Error>
func fetchAttendanceRound(lectureId: Int) -> AnyPublisher<BaseEntity<AttendanceRoundEntity>, Error>
func postAttendance(lectureRoundId: Int, code: Int) -> AnyPublisher<BaseEntity<Int>, Error>
func postAttendance(lectureRoundId: Int, code: String) -> AnyPublisher<BaseEntity<String>, Error>
}

extension DefaultAttendanceService: AttendanceService {

public func fetchAttendanceSchedule() -> AnyPublisher<BaseEntity<AttendanceScheduleEntity>, Error> {
test.requestObjectInCombine(AttendanceAPI.lecture)
opRequestObjectInCombine(AttendanceAPI.lecture)
}

public func fetchAttendanceScore() -> AnyPublisher<BaseEntity<AttendanceScoreEntity>, Error> {
requestObjectInCombine(AttendanceAPI.total)
opRequestObjectInCombine(AttendanceAPI.total)
}

public func fetchAttendanceRound(lectureId: Int) -> AnyPublisher<BaseEntity<AttendanceRoundEntity>, Error> {
requestObjectInCombine(AttendanceAPI.lectureRound(lectureId: lectureId))
opRequestObjectInCombine(AttendanceAPI.lectureRound(lectureId: lectureId))
}

public func postAttendance(lectureRoundId: Int, code: Int) -> AnyPublisher<BaseEntity<Int>, Error> {
requestObjectInCombine(AttendanceAPI.attend(lectureRoundId: lectureRoundId, code: code))
public func postAttendance(lectureRoundId: Int, code: String) -> AnyPublisher<BaseEntity<String>, Error> {
opRequestObjectInCombine(AttendanceAPI.attend(lectureRoundId: lectureRoundId, code: code))
}
}

0 comments on commit b303633

Please sign in to comment.