暫無描述

FKPersonOrderRequest.m 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // FKAllOrderRequest.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 15/8/24.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "FKPersonOrderRequest.h"
  9. @implementation FKPersonOrderRequest
  10. + (void)requestItems:(int)identify
  11. startRow:(NSString *)startRow
  12. pageSize:(NSString *)pageSize
  13. keyword:(NSString *)keyword
  14. tradeStatus:(NSString *)tradeStatus
  15. deleagate:(id<FLNetworkDelegate>)delegate {
  16. if (!startRow || !pageSize || !tradeStatus) {
  17. return;
  18. }
  19. // 当key有值时会忽略status字段
  20. NSArray *keys = @[@"start_row", @"page_size", @"status", @"key"];
  21. NSArray *values = @[startRow, pageSize, tradeStatus, [FLStringHelper replaceNilWithEmpty:keyword]];
  22. NSString *itemJSONString = [FLRequestHelper JSONStringWithKeys:keys
  23. values:values];
  24. NSMutableDictionary *para = [NSMutableDictionary dictionary];
  25. [para setValue:itemJSONString forKey:@"payment_order_json"];
  26. [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  27. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/payment_order/find_payment_orders.json", [[FKServerUtil sharedInstance] apiServer]];
  28. [[FLDataCenter sharedDataCenter] POST:URLString
  29. para:para
  30. identify:identify
  31. delegate:delegate];
  32. }
  33. + (void)requestCancelOrder:(int)identify
  34. orderID:(NSString *)orderID
  35. deleagate:(id<FLNetworkDelegate>)delegate {
  36. NSString *itemJSONString = [FLRequestHelper JSONStringWithKeys:@[@"id"]
  37. values:@[orderID]];
  38. NSMutableDictionary *para = [NSMutableDictionary dictionary];
  39. [para setValue:itemJSONString forKey:@"payment_order_json"];
  40. [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  41. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/payment_order/cancel_payment_order.json", [[FKServerUtil sharedInstance] apiServer]];
  42. [[FLDataCenter sharedDataCenter] POST:URLString
  43. para:para
  44. identify:identify
  45. delegate:delegate];
  46. }
  47. + (void)requestDeleteOrder:(int)identify
  48. orderID:(NSString *)orderID
  49. deleagate:(id<FLNetworkDelegate>)delegate {
  50. NSString *itemJSONString = [FLRequestHelper JSONStringWithKeys:@[@"id"]
  51. values:@[orderID]];
  52. NSMutableDictionary *para = [NSMutableDictionary dictionary];
  53. [para setValue:itemJSONString forKey:@"payment_order_json"];
  54. [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  55. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/payment_order/remove_payment_order.json", [[FKServerUtil sharedInstance] apiServer]];
  56. [[FLDataCenter sharedDataCenter] POST:URLString
  57. para:para
  58. identify:identify
  59. delegate:delegate];
  60. }
  61. + (void)requestOrderBadge:(int)identify deleagate:(id<FLNetworkDelegate>)delegate {
  62. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/payment_order/find_payment_order_count.json", [[FKServerUtil sharedInstance] apiServer]];
  63. [[FLDataCenter sharedDataCenter] POST:URLString
  64. para:[FLRequestHelper commonParamater]
  65. identify:identify
  66. delegate:delegate];
  67. }
  68. @end