12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //
- // RQHTTPService+RQGetPassRate.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/8/22.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHTTPService+RQGetPassRate.h"
- @implementation RQHTTPService (RQGetPassRate)
- /**
- 获取考试通过率
- @return Returns a signal which will send complete, or error.
- */
- - (RACSignal *)getPassRate {
- NSInteger total = [RQ_YDTQuestion_Module getQuestionNumWithWithSubject:RQ_YDTQuestion_Module.subject exerciseType:RQExerciseType_Sequential];
-
-
- /// 1. 配置参数
- RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
-
- subscript[@"userId"] = RQObjectIsNil(RQ_USER_MANAGER.currentUser._id)? @0 : RQ_USER_MANAGER.currentUser._id;
- subscript[@"km"] = @(RQ_YDTQuestion_Module.subject + 1);
- subscript[@"total"] = @(total);
- subscript[@"correct"] = @(10);
- NSString *carTypeStr = [RQ_YDTQuestion_Module getCarTypeCNNameWithCarType:RQ_YDTQuestion_Module.carType];
- subscript[@"carType"] = carTypeStr;
- /// 2. 配置参数模型
- RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path: @"student/getPassRate" parameters:subscript.dictionary];
-
- /// 3.发起请求
- return [[[RQHTTPRequest requestWithParameters:paramters]
- enqueueResultClass:nil]
- rq_parsedResults];
- }
- - (RACSignal *)getPassRateWithSubject:(RQHomePageSubjectType)subject carType:(RQHomePageCarType)carType {
- NSInteger total = [RQ_YDTQuestion_Module getQuestionNumWithWithSubject:RQ_YDTQuestion_Module.subject exerciseType:RQExerciseType_Sequential];
-
-
- /// 1. 配置参数
- RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
-
- subscript[@"userId"] = RQObjectIsNil(RQ_USER_MANAGER.currentUser._id)? @0 : RQ_USER_MANAGER.currentUser._id;
- subscript[@"km"] = @(subject + 1);
- subscript[@"total"] = @(total);
- subscript[@"correct"] = @(10);
- NSString *carTypeStr = [RQ_YDTQuestion_Module getCarTypeCNNameWithCarType:carType];
- subscript[@"carType"] = carTypeStr;
- /// 2. 配置参数模型
- RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path: @"student/getPassRate" parameters:subscript.dictionary];
-
- /// 3.发起请求
- return [[[RQHTTPRequest requestWithParameters:paramters]
- enqueueResultClass:nil]
- rq_parsedResults];
- }
- @end
|