WFCUOrganizationCache.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // WFCUOrganizationCache.h
  3. // WFChatUIKit
  4. //
  5. // Created by Rain on 2022/12/25.
  6. // Copyright © 2022 WildfireChat. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @class WFCUOrganization;
  11. @class WFCUEmployee;
  12. @class WFCUOrgRelationship;
  13. @class WFCUOrganizationEx;
  14. @class WFCUEmployeeEx;
  15. //根节点更新完成
  16. extern NSString *kRootOrganizationUpdated;
  17. //我的组织关系更新完成
  18. extern NSString *kMyOrganizationUpdated;
  19. //组织信息更新完成
  20. extern NSString *kOrganizationUpdated;
  21. //组织层级信息更新完成,包括组织信息,子组织信息,当前层级员工信息
  22. extern NSString *kOrganizationExUpdated;
  23. //员工信息更新完成
  24. extern NSString *kEmployeeUpdated;
  25. //员工附加信息更新完成,包括员工信息及员工的关系
  26. extern NSString *kEmployeeExUpdated;
  27. //关系信息更新完成
  28. extern NSString *kOrgRelationUpdated;
  29. @interface WFCUOrganizationCache : NSObject
  30. + (WFCUOrganizationCache *)sharedCache;
  31. @property(nonatomic, strong)NSArray<NSNumber *> *rootOrganizationIds;
  32. @property(nonatomic, strong)NSArray<NSNumber *> *bottomOrganizationIds;
  33. - (void)loadMyOrganizationInfos;
  34. - (void)clearCaches;
  35. - (void)getRelationship:(NSString *)employeeId
  36. refresh:(BOOL)refresh
  37. success:(void(^)(NSString *employeeId, NSArray<WFCUOrgRelationship *> *rss))successBlock
  38. error:(void(^)(int error_code))errorBlock;
  39. - (NSArray<WFCUOrgRelationship *> *)getRelationship:(NSString *)employeeId refresh:(BOOL)refresh;
  40. - (WFCUEmployee *)getEmployee:(NSString *)employeeId refresh:(BOOL)refresh;
  41. - (WFCUEmployeeEx *)getEmployeeEx:(NSString *)employeeId refresh:(BOOL)refresh;
  42. - (WFCUOrganization *)getOrganization:(NSInteger)orgnaizationId refresh:(BOOL)refresh;
  43. - (void)getOrganizationEx:(NSInteger)organizationId
  44. refresh:(BOOL)refresh
  45. success:(void(^)(NSInteger organizationId, WFCUOrganizationEx *ex))successBlock
  46. error:(void(^)(int error_code))errorBlock;
  47. - (WFCUOrganizationEx *)getOrganizationEx:(NSInteger)organizationId refresh:(BOOL)refresh;
  48. @end
  49. NS_ASSUME_NONNULL_END