// // FKCirDetailRequest.m // FirstLink // // Created by jack on 16/6/16. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKCirDetailRequest.h" @implementation FKCirDetailRequest + (void)reqCirDetailWithID:(NSString *)shareId identify:(int)identify delegate:(id )delegate{ if (!shareId) return; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/share/get_share.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"id"] values:@[shareId]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"share_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqCirRelativeListWithID:(NSString *)shareId startRow:(NSUInteger)startRow identify:(int)identify delegate:(id )delegate{ if (!shareId) return; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/search/recommend_products_for_share.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"share_id", @"start_row", @"page_size"] values:@[shareId, @(startRow), @20]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"recommend_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqCommentWithID:(NSString *)shareId replyToUserID:(NSString *)replyToUserID content:(NSString *)content identify:(int)identify delegate:(id )delegate{ if (!shareId || !content.length) return; if (content.length > 250){ content = [content substringToIndex:250]; } NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/share_comment/create_share_comment.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"share_id", @"content"] values:@[shareId, content]]; if (replyToUserID.length){ jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"share_id", @"content", @"reply_to_user_id"] values:@[shareId, content, replyToUserID]]; } NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"share_comment_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqRmoveCommentWithID:(NSString *)commentID identify:(int)identify delegate:(id )delegate{ if (!commentID) return; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/share_comment/remove_share_comment.json?id=%@", [[FKServerUtil sharedInstance] apiServer], commentID]; [[FLDataCenter sharedDataCenter] POST:urlString para:[FLRequestHelper commonParamater] identify:identify delegate:delegate]; } + (void)reqLike:(BOOL)like identify:(int)identify itemID:(NSString *)itemID delegate:(id )delegate{ if (!itemID.length) return; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/share_like/cancel_share_like.json", [[FKServerUtil sharedInstance] apiServer]]; if (like) { urlString = [NSString stringWithFormat:@"%@/link-site/api/share_like/create_share_like.json", [[FKServerUtil sharedInstance] apiServer]]; } NSString *jsonStr = [FLRequestHelper JSONStringWithKeys:@[@"share_id"] values:@[itemID]]; NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:[FLRequestHelper commonParamater]]; [dictM setObject:jsonStr forKey:@"share_like_json"]; [[FLDataCenter sharedDataCenter] POST:urlString para:dictM identify:identify delegate:delegate]; } + (void)reqShareUrlWithIdentify:(int)identify shareID:(NSString *)shareID deleagate:(id)delegate{ if (!shareID.length) return; NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/share/get_share_url.json", [[FKServerUtil sharedInstance] apiServer]]; NSString *itemJson = [FLRequestHelper JSONStringWithKeys:@[@"source", @"object_id"] values:@[@"5", shareID]]; NSMutableDictionary *para = [NSMutableDictionary dictionary]; [para setValue:itemJson forKey:@"share_json"]; [para addEntriesFromDictionary:[FLRequestHelper commonParamater]]; [[FLDataCenter sharedDataCenter] POST:urlString para:para identify:identify delegate:delegate]; } @end