Нет описания

MessageViewModel.h 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // MessageViewModel.h
  3. // FirstLink
  4. //
  5. // Created by unicode on 14-11-6.
  6. // Copyright (c) 2014年 FirstLink. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "FKAppMessage.h"
  10. typedef NS_ENUM(NSInteger, kMessageSectionType) {
  11. kMessageSectionTypeNone,
  12. kMessageSectionTypeToday,
  13. kMessageSectionTypeLast7Day,
  14. kMessageSectionTypeLast30Day,
  15. kMessageSectionTypeEarlier
  16. };
  17. @class FKBadgeMessage;
  18. @class FKPersonOrderBadgeItem;
  19. @interface MessageViewModel : NSObject
  20. @property (nonatomic, strong) PageHeader *pageHeader;
  21. @property (nonatomic, strong) NSMutableArray *appMessages;
  22. + (void)requestUsers:(NSArray*)userIDs
  23. success:(void (^)(MSGHeader *header, id responseObject))success
  24. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  25. - (void)requestMessageWithIndex:(NSString*)index
  26. AnchorID:(NSString*)anchorID
  27. startRow:(NSString*)startRow
  28. pageSize:(NSString*)pageSize
  29. type:(NSString*)type
  30. success:(void (^)(MSGHeader *header, id responseObject, NSString *serverTime))success
  31. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  32. + (void)requestBadgeSuccess:(void (^)(MSGHeader *header, FKBadgeMessage *badge, FKAppMessage *comment))success
  33. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  34. + (void)requestOrderBadgeSuccess:(void (^)(MSGHeader *header, FKPersonOrderBadgeItem *badge))success
  35. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  36. + (void)requestExpiredCouponSuccess:(void (^)(MSGHeader *header, NSInteger))success
  37. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  38. + (void)markMessageRead:(NSString*)msgID
  39. msgType:(NSString*)type
  40. success:(void (^)(MSGHeader *header, id responseObject))success
  41. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  42. - (void)removeAllMessages;
  43. - (void)addMessages:(NSArray*)messages;
  44. - (void)addTimelineMessages:(NSArray*)messages serverTime:(NSString *)serverTime;
  45. - (void)removeTimelineMessages;
  46. - (NSInteger)numberOfTimelineSectionsInTableView;
  47. - (NSInteger)numberOfRowsInTimelineSection:(NSInteger)section;
  48. - (FKAppMessage*)timelineItemAtIndex:(NSIndexPath *)indexPath;
  49. - (NSString *)timelineHeaderMessageAtIndexPath:(NSIndexPath *)indexPath;
  50. - (BOOL)hasTimelineMessage;
  51. @end