JXHelperModel.m 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // JXHelperModel.m
  3. // shiku_im
  4. //
  5. // Created by 1 on 2019/5/28.
  6. // Copyright © 2019年 Reese. All rights reserved.
  7. //
  8. #import "JXHelperModel.h"
  9. @implementation JXHelperModel
  10. - (void)getDataWithDict:(NSDictionary *)dict {
  11. self.desc = [dict objectForKey:@"desc"];
  12. self.developer = [dict objectForKey:@"developer"];
  13. self.iconUrl = [dict objectForKey:@"iconUrl"];
  14. self.helperId = [dict objectForKey:@"id"];
  15. self.link = [dict objectForKey:@"link"];
  16. self.name = [dict objectForKey:@"name"];
  17. self.openAppId = [dict objectForKey:@"openAppId"];
  18. self.type = [[dict objectForKey:@"type"] intValue];
  19. self.urlScheme = [dict objectForKey:@"iosUrlScheme"];
  20. if ([dict objectForKey:@"other"]) {
  21. self.appName = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"appName"];
  22. self.subTitle = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"subTitle"];
  23. self.url = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"url"];
  24. }
  25. }
  26. + (instancetype)initWithDict:(NSDictionary *)dict {
  27. JXHelperModel *model = [[JXHelperModel alloc] init];
  28. model.desc = [dict objectForKey:@"desc"];
  29. model.developer = [dict objectForKey:@"developer"];
  30. model.iconUrl = [dict objectForKey:@"iconUrl"];
  31. model.helperId = [dict objectForKey:@"id"];
  32. model.link = [dict objectForKey:@"link"];
  33. model.name = [dict objectForKey:@"name"];
  34. model.openAppId = [dict objectForKey:@"openAppId"];
  35. model.type = [[dict objectForKey:@"type"] intValue];
  36. model.urlScheme = [dict objectForKey:@"iosUrlScheme"];
  37. if ([dict objectForKey:@"other"]) {
  38. model.appName = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"appName"];
  39. model.subTitle = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"subTitle"];
  40. model.url = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"url"];
  41. model.imageUrl = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"imageUrl"];
  42. model.appIcon = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"appIcon"];
  43. model.downloadUrl = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"downloadUrl"];
  44. model.title = [(NSDictionary *)[dict objectForKey:@"other"] objectForKey:@"title"];
  45. }
  46. return model;
  47. }
  48. @end