XSUser.m 684 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // XSUser.m
  3. // XenonSDK
  4. //
  5. // Created by SAGESSE on 2019/5/29.
  6. // Copyright © 2019 SAGESSE. All rights reserved.
  7. //
  8. #import "XSUser.h"
  9. #import "XSDataCenter.h"
  10. @implementation XSUser
  11. + (BOOL)propertyIsOptional:(NSString *)propertyName {
  12. return YES;
  13. }
  14. NSArray* g_history;
  15. + (void)setHistory:(NSArray<XSUser *> *)history {
  16. [XSDataCenter setValue:history forKey:@"User.history"];
  17. g_history = history;
  18. }
  19. + (NSArray<XSUser*>*)history {
  20. if (g_history != nil) {
  21. return g_history;
  22. }
  23. g_history = [XSDataCenter valueForKey:@"User.history"];
  24. return g_history;
  25. }
  26. - (NSString*)name {
  27. return self.account ?: self.userName ?: self.uid;
  28. }
  29. @end