Sin descripción

FKBookRequest.m 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // FKBookRequest.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/4/28.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKBookRequest.h"
  9. #import "FKBrandSubscribeRequest.h"
  10. @implementation FKBookRequest
  11. + (void)reqBookListWithIdentify:(int)identify
  12. brandID:(NSString *)brandID
  13. startRow:(NSUInteger)startRow
  14. serveTime:(NSString *)serveTime
  15. delegate:(id<FLNetworkDelegate>)delegate{
  16. NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/subscribe/my_subscribe.json", [[FKServerUtil sharedInstance] apiServer]];
  17. NSMutableArray *keyArrayM = [NSMutableArray arrayWithArray:@[@"type", @"start_row", @"page_size"]];
  18. NSMutableArray *valueArrayM = [NSMutableArray arrayWithArray:@[@(14), @(startRow), @(20)]];
  19. if (brandID.length){
  20. [keyArrayM addObject:@"value"];
  21. [valueArrayM addObject:brandID];
  22. }
  23. if ([FLStringHelper isValidString:serveTime]){
  24. [keyArrayM addObject:@"update_time"];
  25. [valueArrayM addObject:serveTime];
  26. }
  27. NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:keyArrayM values:valueArrayM];
  28. NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]];
  29. [dictM setObject:jsonStr forKey:@"subscribe_json"];
  30. [[FLDataCenter sharedDataCenter] POST:urlString
  31. para:dictM
  32. identify:identify
  33. delegate:delegate];
  34. }
  35. + (void)reqRecBookListWithIdentify:(int)identify
  36. delegate:(id<FLNetworkDelegate>)delegate{
  37. NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/subscribe/hot_subscribe.json", [[FKServerUtil sharedInstance] apiServer]];
  38. NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"type"] values:@[@(14)]];
  39. NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]];
  40. [dictM setObject:jsonStr forKey:@"subscribe_json"];
  41. [[FLDataCenter sharedDataCenter] POST:urlString
  42. para:dictM
  43. identify:identify
  44. delegate:delegate];
  45. }
  46. + (void)reqBookBrand:(NSString *)brandID
  47. isCancel:(BOOL)cancel
  48. identify:(int)identify
  49. delegate:(id<FLNetworkDelegate>)delegate{
  50. if (![FLStringHelper isValidString:brandID]) return;
  51. if (cancel){
  52. [FKBrandSubscribeRequest requestCancelSubscribe:@[brandID] identify:identify delegate:delegate];
  53. }else{
  54. [FKBrandSubscribeRequest requestCreateSubscribe:@[brandID] identify:identify delegate:delegate];
  55. }
  56. }
  57. @end