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