No Description

FKShoppingLiveRequest.m 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // FKShoppingLiveRequest.m
  3. // FirstLink
  4. //
  5. // Created by Lofty on 16/10/13.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKShoppingLiveRequest.h"
  9. const int ShoppingLiveListRequestIdentify = 2001;
  10. const int ShoppingLiveNextPageRequestIdentify = 2002;
  11. @implementation FKShoppingLiveRequest
  12. + (void)requestShoppingLivesDataWithDelegate:(id<FLNetworkDelegate>)delegate{
  13. NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/live/find_shopping_lives.json", [[FKServerUtil sharedInstance] apiServer]];
  14. NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size"]
  15. values:@[@0, @PAGE_RECORD_COUNT]];
  16. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  17. [dict setValue:itemJson forKey:@"shopping_live_json"];
  18. [dict addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  19. [[FLDataCenter sharedDataCenter] POST:urlString
  20. para:dict
  21. identify:ShoppingLiveListRequestIdentify
  22. delegate:delegate];
  23. }
  24. + (void)requestNextPageWithStartRow:(NSUInteger)startRow
  25. anchorID:(NSString *)anchor_id
  26. delegate:(id<FLNetworkDelegate>)delegate{
  27. NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/live/find_shopping_lives.json", [[FKServerUtil sharedInstance] apiServer]];
  28. NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size", @"anchor_id"]
  29. values:@[@(startRow), @(PAGE_RECORD_COUNT), [FLStringHelper replaceNilWithEmpty:anchor_id]]];
  30. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  31. [dict setValue:itemJson forKey:@"shopping_live_json"];
  32. [dict addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  33. [[FLDataCenter sharedDataCenter] POST:urlString para:dict identify:ShoppingLiveNextPageRequestIdentify delegate:delegate];
  34. }
  35. @end