RQHTTPService+RQGetChapterList.m 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // RQHTTPService+RQGetChapterList.m
  3. // YYXC
  4. //
  5. // Created by 张嵘 on 2022/7/14.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQHTTPService+RQGetChapterList.h"
  9. @implementation RQHTTPService (RQGetChapterList)
  10. /**
  11. 查询章节列表
  12. @return Returns a signal which will send complete, or error.
  13. */
  14. - (RACSignal *)getChapterList {
  15. /// 1. 配置参数
  16. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  17. // subscript[@""] = @"";
  18. NSString *path = RQ_GET_Chapter_XC_1;
  19. switch (RQ_YDTQuestion_Module.carType) {
  20. case RQHomePageCarType_Car: {
  21. if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
  22. path = RQ_GET_Chapter_XC_1;
  23. } else {
  24. path = RQ_GET_Chapter_XC_4;
  25. }
  26. break;
  27. }
  28. case RQHomePageCarType_Truck: {
  29. if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
  30. path = RQ_GET_Chapter_HC_1;
  31. } else {
  32. path = RQ_GET_Chapter_HC_4;
  33. }
  34. break;
  35. }
  36. case RQHomePageCarType_Bus: {
  37. if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
  38. path = RQ_GET_Chapter_KC_1;
  39. } else {
  40. path = RQ_GET_Chapter_KC_4;
  41. }
  42. break;
  43. }
  44. case RQHomePageCarType_Motorcycle: {
  45. if (RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne) {
  46. path = RQ_GET_Chapter_MTC_1;
  47. } else {
  48. path = RQ_GET_Chapter_MTC_4;
  49. }
  50. break;
  51. }
  52. case RQHomePageCarType_ZGZ_JLY: {
  53. path = RQ_GET_Chapter_ZGZ_JLY;
  54. break;
  55. }
  56. case RQHomePageCarType_ZGZ_KY: {
  57. path = RQ_GET_Chapter_ZGZ_KY;
  58. break;
  59. }
  60. case RQHomePageCarType_ZGZ_HY: {
  61. path = RQ_GET_Chapter_ZGZ_HY;
  62. break;
  63. }
  64. case RQHomePageCarType_ZGZ_WXP: {
  65. path = RQ_GET_Chapter_ZGZ_WXP;
  66. break;
  67. }
  68. case RQHomePageCarType_ZGZ_CZC: {
  69. path = RQ_GET_Chapter_ZGZ_CZC;
  70. break;
  71. }
  72. case RQHomePageCarType_ZGZ_WYC: {
  73. path = RQ_GET_Chapter_ZGZ_WYC;
  74. break;
  75. }
  76. default:
  77. break;
  78. }
  79. /// 2. 配置参数模型
  80. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_GET path:path parameters:subscript.dictionary];
  81. /// 3.发起请求
  82. return [[[RQHTTPRequest requestWithParameters:paramters]
  83. enqueueResultClass:[RQDictInfoModel class]]
  84. rq_parsedResults];
  85. }
  86. @end