WFCUOrganization.m 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // WFCUOrganization.m
  3. // WFChatUIKit
  4. //
  5. // Created by Rain on 2022/12/25.
  6. // Copyright © 2022 WildfireChat. All rights reserved.
  7. //
  8. #import "WFCUOrganization.h"
  9. @implementation WFCUOrganization
  10. + (WFCUOrganization *)fromDict:(NSDictionary *)dict {
  11. WFCUOrganization *org = [[WFCUOrganization alloc] init];
  12. org.organizationId = [dict[@"id"] intValue];
  13. org.parentId = [dict[@"parentId"] intValue];
  14. org.managerId = dict[@"managerId"];
  15. org.name = dict[@"name"];
  16. org.desc = dict[@"desc"];
  17. org.portraitUrl = dict[@"portraitUrl"];
  18. org.tel = dict[@"tel"];
  19. org.office = dict[@"office"];
  20. org.groupId = dict[@"groupId"];
  21. org.memberCount = [dict[@"memberCount"] intValue];
  22. org.sort = [dict[@"sort"] intValue];
  23. org.updateDt = [dict[@"updateDt"] longLongValue];
  24. org.createDt = [dict[@"createDt"] longLongValue];
  25. return org;
  26. }
  27. - (NSDictionary *)toDict {
  28. NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
  29. dict[@"id"] = @(self.organizationId);
  30. dict[@"parentId"] = @(self.parentId);
  31. dict[@"managerId"] = self.managerId;
  32. dict[@"name"] = self.name;
  33. dict[@"desc"] = self.desc;
  34. dict[@"portraitUrl"] = self.portraitUrl;
  35. dict[@"tel"] = self.tel;
  36. dict[@"office"] = self.office;
  37. dict[@"groupId"] = self.groupId;
  38. dict[@"memberCount"] = @(self.memberCount);
  39. dict[@"sort"] = @(self.sort);
  40. dict[@"updateDt"] = @(self.updateDt);
  41. dict[@"createDt"] = @(self.createDt);
  42. return dict;
  43. }
  44. @end