Keine Beschreibung

FKMessageRequest.m 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // FKAssistantRequest.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 15/7/31.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "FKMessageRequest.h"
  9. @implementation FKMessageRequest
  10. + (void)requestAssistantPrivilege:(int)identify deleagate:(id<FLNetworkDelegate>)delegate {
  11. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/get_my_vip_info.json", [[FKServerUtil sharedInstance] apiServer]];
  12. [[FLDataCenter sharedDataCenter] POST:URLString
  13. para:[FLRequestHelper commonParamater]
  14. identify:identify
  15. delegate:delegate];
  16. }
  17. + (void)requestHistoryMessage:(int)identify
  18. group:(NSString *)groupID
  19. timestamp:(NSInteger)timestamp
  20. count:(int)count
  21. deleagate:(id<FLNetworkDelegate>)delegate {
  22. NSArray *keys, *values;
  23. if (timestamp > 0) {
  24. keys = @[@"user_id", @"group_id", @"timestamp", @"limit"];
  25. values = @[[FKUserManager sharedManager].user.userID,
  26. [FLStringHelper replaceNilWithEmpty:groupID],
  27. [NSString stringWithFormat:@"%lu", timestamp],
  28. [NSString stringWithFormat:@"%d", count]];
  29. } else {
  30. // keys = @[@"user_id", @"group_id", @"limit"];
  31. // values= @[[FKUserManager sharedManager].user.userID,
  32. // [FLStringHelper replaceNilWithEmpty:groupID],
  33. // [NSString stringWithFormat:@"%d", count]];
  34. keys = @[@"user_id", @"group_id"];
  35. values= @[[FKUserManager sharedManager].user.userID,
  36. [FLStringHelper replaceNilWithEmpty:groupID]];
  37. }
  38. NSString *itemJSONString = [FLRequestHelper JSONStringWithKeys:keys
  39. values:values];
  40. NSMutableDictionary *para = [NSMutableDictionary dictionary];
  41. [para setValue:itemJSONString forKey:@"group_chat_json"];
  42. [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
  43. NSString *URLString = [NSString stringWithFormat:@"%@/link-site/api/chat_log/find_group_chat_logs.json", [[FKServerUtil sharedInstance] apiServer]];
  44. [[FLDataCenter sharedDataCenter] POST:URLString
  45. para:para
  46. identify:identify
  47. delegate:delegate];
  48. }
  49. @end