RQHTTPService+RQGetTreeList.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // RQHTTPService+RQGetTreeList.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2021/10/25.
  6. // Copyright © 2021 JCZ. All rights reserved.
  7. //
  8. #import "RQHTTPService+RQGetTreeList.h"
  9. @implementation RQHTTPService (RQGetTreeList)
  10. /**
  11. 查询教学视频分类树形列表
  12. @return Returns a signal which will send complete, or error.
  13. */
  14. - (RACSignal *)getTreeList {
  15. /// 1. 配置参数
  16. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  17. // subscript[@""] = @"";
  18. /// 2. 配置参数模型
  19. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_GET path:RQ_GET_TreeList parameters:subscript.dictionary];
  20. /// 3.发起请求
  21. return [[[RQHTTPRequest requestWithParameters:paramters]
  22. enqueueResultClass:[RQTreeListModel class]]
  23. rq_parsedResults];
  24. }
  25. /**
  26. 根据分类ID查询教学视频
  27. @param videoTypeId 分类ID
  28. @return Returns a signal which will send complete, or error.
  29. */
  30. - (RACSignal *)getTeachingVideoByTypeId:(NSInteger)videoTypeId {
  31. /// 1. 配置参数
  32. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  33. subscript[@"videoTypeId"] = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:videoTypeId]];
  34. /// 2. 配置参数模型
  35. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_GET path:RQ_GET_TeachingVideoByTypeId parameters:subscript.dictionary];
  36. /// 3.发起请求
  37. return [[[RQHTTPRequest requestWithParameters:paramters]
  38. enqueueResultClass:[VideosItem class]]
  39. rq_parsedResults];
  40. }
  41. @end