1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // RQHTTPService+RQGetChapterList.m
- // YYXC
- //
- // Created by 张嵘 on 2022/7/14.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHTTPService+RQGetChapterList.h"
- @implementation RQHTTPService (RQGetChapterList)
- /**
- 查询章节列表
- @return Returns a signal which will send complete, or error.
- */
- - (RACSignal *)getChapterList {
- /// 1. 配置参数
- RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
- // subscript[@""] = @"";
-
- NSString *path = RQ_GET_Chapter_XC_1;
- switch (RQ_YDTQuestion_Module.carType) {
- case RQHomePageCarType_Car: {
- if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
- path = RQ_GET_Chapter_XC_1;
- } else {
- path = RQ_GET_Chapter_XC_4;
- }
- break;
- }
- case RQHomePageCarType_Truck: {
- if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
- path = RQ_GET_Chapter_HC_1;
- } else {
- path = RQ_GET_Chapter_HC_4;
- }
- break;
- }
- case RQHomePageCarType_Bus: {
- if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
- path = RQ_GET_Chapter_KC_1;
- } else {
- path = RQ_GET_Chapter_KC_4;
- }
- break;
- }
- case RQHomePageCarType_Motorcycle: {
- if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
- path = RQ_GET_Chapter_MTC_1;
- } else {
- path = RQ_GET_Chapter_MTC_4;
- }
- break;
- }
- case RQHomePageCarType_ZGZ_JLY: {
- path = RQ_GET_Chapter_ZGZ_JLY;
- break;
- }
- case RQHomePageCarType_ZGZ_KY: {
- path = RQ_GET_Chapter_ZGZ_KY;
- break;
- }
- case RQHomePageCarType_ZGZ_HY: {
- path = RQ_GET_Chapter_ZGZ_HY;
- break;
- }
- case RQHomePageCarType_ZGZ_WXP: {
- path = RQ_GET_Chapter_ZGZ_WXP;
- break;
- }
- case RQHomePageCarType_ZGZ_CZC: {
- path = RQ_GET_Chapter_ZGZ_CZC;
- break;
- }
- case RQHomePageCarType_ZGZ_WYC: {
- path = RQ_GET_Chapter_ZGZ_WYC;
- break;
- }
-
- default:
- break;
- }
-
- /// 2. 配置参数模型
- RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_GET path:path parameters:subscript.dictionary];
-
- /// 3.发起请求
- return [[[RQHTTPRequest requestWithParameters:paramters]
- enqueueResultClass:[RQDictInfoModel class]]
- rq_parsedResults];
- }
- @end
|