// // RQHTTPService+RQSaveBetchFavQuestion.m // jiaPei // // Created by 张嵘 on 2022/8/25. // Copyright © 2022 JCZ. All rights reserved. // #import "RQHTTPService+RQSaveBetchFavQuestion.h" @implementation RQHTTPService (RQSaveBetchFavQuestion) /** 新增题目记录 @param questionId 题目ID @param type 1是收藏,2是错题,3是排除的题 @return Returns a signal which will send complete, or error. */ - (RACSignal *)saveBetchFavQuestionWithQuestionId:(NSInteger)questionId type:(RQSaveFavQuestionType)type { /// 1. 配置参数 RQKeyedSubscript *subscript = [RQKeyedSubscript subscript]; NSString *pinStr = [NSString stringWithFormat:@"%ld,%@;",questionId,(RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectFour)? @"4" : @"1"]; if (type == RQSaveFavQuestionType_Collect) { subscript[@"favArr"] = pinStr; subscript[@"wrongArr"] = @""; } else if (type == RQSaveFavQuestionType_Wrong) { subscript[@"favArr"] = @""; subscript[@"wrongArr"] = pinStr; } subscript[@"pcArr"] = @""; subscript[@"user"] = RQObjectIsNil(RQ_USER_MANAGER.currentUser._id)? @0 : RQ_USER_MANAGER.currentUser._id; subscript[@"carType"] = RQ_YDTQuestion_Module.car_type; /// 2. 配置参数模型 RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path:RQ_POST_SaveBetchFavQuestion parameters:subscript.dictionary]; /// 3.发起请求 return [[[RQHTTPRequest requestWithParameters:paramters] enqueueResultClass:RQBaseModel.class] rq_parsedResults]; } @end