// // FKShoppingLiveRequest.m // FirstLink // // Created by Lofty on 16/10/13. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKShoppingLiveRequest.h" const int ShoppingLiveListRequestIdentify = 2001; const int ShoppingLiveNextPageRequestIdentify = 2002; @implementation FKShoppingLiveRequest + (void)requestShoppingLivesDataWithDelegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/live/find_shopping_lives.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size"] values:@[@0, @PAGE_RECORD_COUNT]]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setValue:itemJson forKey:@"shopping_live_json"]; [dict addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dict identify:ShoppingLiveListRequestIdentify delegate:delegate]; } + (void)requestNextPageWithStartRow:(NSUInteger)startRow anchorID:(NSString *)anchor_id delegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/live/find_shopping_lives.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size", @"anchor_id"] values:@[@(startRow), @(PAGE_RECORD_COUNT), [FLStringHelper replaceNilWithEmpty:anchor_id]]]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setValue:itemJson forKey:@"shopping_live_json"]; [dict addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dict identify:ShoppingLiveNextPageRequestIdentify delegate:delegate]; } @end