JXGetPacketList.m 940 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // JXGetPacketList.m
  3. // shiku_im
  4. //
  5. // Created by Apple on 16/8/30.
  6. // Copyright © 2016年 Reese. All rights reserved.
  7. //
  8. #import "JXGetPacketList.h"
  9. @implementation JXGetPacketList
  10. + (NSArray*)getPackList:(NSDictionary*)dataDict{
  11. NSArray * array = dataDict[@"data"][@"list"];
  12. if (array == nil) {
  13. array = dataDict[@"list"];
  14. }
  15. NSMutableArray * packetList = [[NSMutableArray alloc]init];
  16. for (NSDictionary * dict in array) {
  17. JXGetPacketList * packet = [[JXGetPacketList alloc]init];
  18. packet.recodeId = dict[@"id"];
  19. packet.money = [dict[@"money"] floatValue];
  20. packet.redId = dict[@"redId"];
  21. packet.time = [dict[@"time"] longValue];
  22. packet.userId = dict[@"userId"];
  23. packet.userName = dict[@"userName"];
  24. packet.reply = dict[@"reply"];
  25. [packetList addObject:packet];
  26. // [packet release];
  27. }
  28. return packetList;
  29. }
  30. @end