123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- //
- // 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 <FLNetworkDelegate>)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 <FLNetworkDelegate>)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 <FLNetworkDelegate>)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 <FLNetworkDelegate>)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 <FLNetworkDelegate>)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<FLNetworkDelegate>)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
|