// // FKRecommendRequest.m // FirstLink // // Created by jack on 15/12/8. // Copyright © 2015年 FirstLink. All rights reserved. // #import "FKRecommendRequest.h" const int REC_INITIAL_DATA_REQ = 110; const int REC_MORE_DATA_REQ = 111; const int REC_TAB_PAGE_REQ = 112; const int REC_REQUEST_ACTIVITY_URL = 113; const int REC_SIGN_STATE = 114; const int REC_DYNAMIC_MESSAGE = 115; const int REC_POINT_MESSAGE = 116; const int REC_BOOK_BRAND_INFO = 117; const int REC_RANDOM_BRAND = 118; const int REC_SCAN_DATA_REQ = 120; const int REC_USER_DATA_REQ = 121; const int REC_ACTIVITY_SHARE = 122; const int REC_PROMOTION_INFO = 123; @implementation FKRecommendRequest + (void)requestTabPagesWithIdentify:(int)identify delegate:(id)delegate{ NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/tab_page/find_tab_pages.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:URLString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)requestRecommendDataWithDelegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/product/find_index_datas_new.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size"] values:@[@(0), @(PAGE_RECORD_COUNT)]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; [dictM setValue:itemJson forKey:@"product_json"]; [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:REC_INITIAL_DATA_REQ delegate:delegate]; } + (void)requestUserRecommendDataWithDelegate:(id)delegate { if ([FKUserManager isUserLogin]) { NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/recommend/find_recommend_products.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size"] values:@[@(0), @(PAGE_RECORD_COUNT)]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; [dictM setValue:itemJson forKey:@"recommend_json"]; [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:REC_USER_DATA_REQ delegate:delegate]; } } + (void)requestScanRecommendDataWithDelegate:(id)delegate { if ([FKUserManager isUserLogin]) { NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/product/find_recommend_products.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size"] values:@[@(0), @(PAGE_RECORD_COUNT)]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; [dictM setValue:itemJson forKey:@"product_json"]; [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:REC_SCAN_DATA_REQ delegate:delegate]; } } + (void)requestRandomBrandWithDelegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/product/find_random_brands.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:urlString para:[FLRequestHelper commonParamater] identify:REC_RANDOM_BRAND delegate:delegate]; } + (void)requestActivityShareWithDelegate:(id)delegate { NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"type", @"ts", @"start_row", @"page_size"] values:@[@(2), @(1), @(0), @(2)]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; [dictM setValue:itemJson forKey:@"activity_share_json"]; [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/activity_share/find_activity_shares.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:REC_ACTIVITY_SHARE delegate:delegate]; } + (void)requestPromotionInfoWithDelegate:(id)delegate { NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/home/find_blocks.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:urlString para:[FLRequestHelper commonParamater] identify:REC_PROMOTION_INFO delegate:delegate]; } + (void)requestMoreDataWithStartRow:(NSUInteger)startRow updateTime:(NSString *)updateTime delegate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/product/find_index_datas_new.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"start_row", @"page_size", @"update_time"] values:@[@(startRow), @(PAGE_RECORD_COUNT), [FLStringHelper replaceNilWithEmpty:updateTime]]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; [dictM setValue:itemJson forKey:@"product_json"]; [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:REC_MORE_DATA_REQ delegate:delegate]; } + (void)requestActivityURL:(int)identify deleagate:(id)delegate { NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/initconf.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:URLString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)requestSignState:(int)identify deleagate:(id)delegate{ NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/user_score/get_user_score_by_sign.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:URLString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)requestPointMessage:(int)identify delegate:(id)delegate{ NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/user_score/get_share_user_score.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:URLString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)requestBookInfoWithServeTime:(NSString *)serveTime identify:(int)identify deleagate:(id)delegate{ NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/subscribe/subscribe_message.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = nil; if ([FLStringHelper isValidString:serveTime]){ itemJson = [FLRequestHelper JSONStringWithKeys:@[@"last_time"] values:@[serveTime]]; } NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; if (itemJson){ [dictM setValue:itemJson forKey:@"subscribe_json"]; } [dictM addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)requestDynamicMsgWithIdentify:(int)identify deleagate:(id)delegate{ NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/cash_coupon/find_messages.json", [[FKServerUtil sharedInstance] apiServer]]; [[FLDataCenter sharedDataCenter] POST:URLString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)requestBehavior:(NSString *)areaName objType:(NSString *)objType objID:(NSString *)objID positionV1:(NSString *)v1 positionV2:(NSString *)v2 { [BehaviorTrackManger requestBehavior:@"index" areaName:areaName objType:objType objID:objID positionV1:v1 positionV2:v2]; } @end