123456789101112131415161718192021222324252627282930313233343536373839 |
- //
- // CoachService.swift
- // JiaPeiManage
- //
- // Created by Ning.ge on 2023/6/13.
- //
- import RxSwift
- import RxCocoa
- import SwiftyJSON
- protocol CoachServiceType {
- //获取教练信息
- func coachInfoRequest(id:String ,city:String) -> Single<UserInfo>
- //获取教练二维码
- func coachQrInfoRequest(id:String ,city:String) -> Single<UserInfo>
-
- }
- final class CoachService: CoachServiceType {
- private let networking : CoachNetworking
-
- init(networking: CoachNetworking) {
- self.networking = networking
- }
-
- func coachInfoRequest(id: String, city: String) -> RxSwift.Single<UserInfo> {
- let api = CoachAPI.coachInfo(id: id, city: city)
- return networking.request(api).map(UserInfo.self)
- }
-
- func coachQrInfoRequest(id: String, city: String) -> RxSwift.Single<UserInfo> {
- let api = CoachAPI.coachQrInfo(id: id, city: city)
- return networking.request(api).map(UserInfo.self)
- }
-
- }
|