1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // StatisticsService.swift
- // JiaPeiManage
- //
- // Created by Ning.ge on 2023/6/26.
- //
- import RxSwift
- import RxCocoa
- import SwiftyJSON
- protocol StatisticsServiceType {
-
- //查询每日报名数
- func everyDayStuCountRequest(city: String, schoolId: Int, startDate: String, endDate: String,fieldType:Int,sortType:Int) -> Single<StuCountDataModel>
- //查询每月报名数
- func everyMonthStuCount(city: String, schoolId: Int, startMonth: String, endMonth: String,fieldType:Int,sortType:Int) -> Single<StuCountDataModel>
- //查询每年报名数
- func everyYearStuCount(city: String, schoolId: Int, startYear: String, endYear: String,fieldType:Int,sortType:Int) -> Single<StuCountDataModel>
- //查询驾校ID 报名数
- func statisticsStuCount(city: String, schoolId: Int) -> Single<StuTotalCountDataModel>
-
- }
- final class StatisticsService: StatisticsServiceType {
-
- private let networking : StatisticsNetworking
-
- init(networking: StatisticsNetworking) {
- self.networking = networking
- }
- //查询每日报名数
- func everyDayStuCountRequest(city: String, schoolId: Int, startDate: String, endDate: String,fieldType:Int,sortType:Int) -> RxSwift.Single<StuCountDataModel> {
- let api = StatisticsAPI.everyDayStuCount(city: city, schoolId: schoolId, startDate: startDate, endDate: endDate , fieldType: fieldType, sortType: sortType)
- return networking.request(api).map(StuCountDataModel.self, isModel: true)
- }
- //查询每月报名数
- func everyMonthStuCount(city: String, schoolId: Int, startMonth: String, endMonth: String,fieldType:Int,sortType:Int) -> RxSwift.Single<StuCountDataModel> {
- let api = StatisticsAPI.everyMonthStuCount(city: city, schoolId: schoolId, startMonth: startMonth, endMonth: endMonth, fieldType: fieldType, sortType: sortType)
- return networking.request(api).map(StuCountDataModel.self, isModel: true)
- }
- //查询每年报名数
- func everyYearStuCount(city: String, schoolId: Int, startYear: String, endYear: String,fieldType:Int,sortType:Int) -> RxSwift.Single<StuCountDataModel> {
- let api = StatisticsAPI.everyYearStuCount(city: city, schoolId: schoolId, startYear: startYear, endYear: endYear, fieldType: fieldType, sortType: sortType)
- return networking.request(api).map(StuCountDataModel.self, isModel: true)
- }
- //查询驾校ID 报名数
- func statisticsStuCount(city: String, schoolId: Int) -> RxSwift.Single<StuTotalCountDataModel> {
- let api = StatisticsAPI.statisticsStuCount(city: city, schoolId: schoolId)
- return networking.request(api).map(StuTotalCountDataModel.self)
- }
-
- }
|