RQHTTPService+RQPostPrepareOrder.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // RQHTTPService+RQPostPrepareOrder.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/3/3.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. // 极速驾培微信下单
  8. #import "RQHTTPService+RQPostPrepareOrder.h"
  9. @implementation RQHTTPService (RQPostPrepareOrder)
  10. /**
  11. 极速驾培微信下单
  12. @param dictCode 商品字典编码
  13. @param userId 用户Id
  14. @return Returns a signal which will send complete, or error.
  15. */
  16. - (RACSignal *)postPrepareOrderWithDictCode:(NSInteger)dictCode userId:(NSString *)userId {
  17. /// 1. 配置参数
  18. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  19. subscript[@"dictCode"] = @(dictCode);
  20. subscript[@"userId"] = @([userId integerValue]);
  21. subscript[@"phoneType"] = @1;
  22. /// 2. 配置参数模型
  23. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path:RQ_POST_PrepareOrder parameters:subscript.dictionary];
  24. /// 3.发起请求
  25. return [[[RQHTTPRequest requestWithParameters:paramters]
  26. enqueueResultClass:[RQPrepareOrderModel class]]
  27. rq_parsedResults];
  28. }
  29. /**
  30. 微信支付下单
  31. @return Returns a signal which will send complete, or error.
  32. */
  33. - (RACSignal *)postPrepareOrderWithGoodsId:(NSString *)goodsId userId:(NSString *)userId goodsType:(RQGoodsType)goodsType {
  34. /// 1. 配置参数
  35. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  36. /// 商品ID(考场ID)
  37. subscript[@"goodsId"] = @([goodsId longValue]);
  38. /// 商品类型 1:考场 2:实物
  39. subscript[@"goodsType"] = @(goodsType);
  40. /// 手机类型 1苹果 2安卓
  41. subscript[@"phoneType"] = @(1);
  42. subscript[@"userId"] = @([userId integerValue]);
  43. /// 2. 配置参数模型
  44. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path:RQ_POST_PrepareGoodsOrder parameters:subscript.dictionary];
  45. /// 3.发起请求
  46. return [[[RQHTTPRequest requestWithParameters:paramters]
  47. enqueueResultClass:[RQPrepareOrderModel class]]
  48. rq_parsedResults];
  49. }
  50. @end