// // FKBookRequest.m // FirstLink // // Created by jack on 16/4/28. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKBookRequest.h" #import "FKBrandSubscribeRequest.h" @implementation FKBookRequest + (void)reqBookListWithIdentify:(int)identify brandID:(NSString *)brandID startRow:(NSUInteger)startRow serveTime:(NSString *)serveTime delegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/subscribe/my_subscribe.json", [[FKServerUtil sharedInstance] apiServer]]; NSMutableArray *keyArrayM = [NSMutableArray arrayWithArray:@[@"type", @"start_row", @"page_size"]]; NSMutableArray *valueArrayM = [NSMutableArray arrayWithArray:@[@(14), @(startRow), @(20)]]; if (brandID.length){ [keyArrayM addObject:@"value"]; [valueArrayM addObject:brandID]; } if ([FLStringHelper isValidString:serveTime]){ [keyArrayM addObject:@"update_time"]; [valueArrayM addObject:serveTime]; } NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:keyArrayM values:valueArrayM]; NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"subscribe_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqRecBookListWithIdentify:(int)identify delegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/subscribe/hot_subscribe.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"type"] values:@[@(14)]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"subscribe_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqBookBrand:(NSString *)brandID isCancel:(BOOL)cancel identify:(int)identify delegate:(id)delegate{ if (![FLStringHelper isValidString:brandID]) return; if (cancel){ [FKBrandSubscribeRequest requestCancelSubscribe:@[brandID] identify:identify delegate:delegate]; }else{ [FKBrandSubscribeRequest requestCreateSubscribe:@[brandID] identify:identify delegate:delegate]; } } @end