AddressModel.m 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // AddressModel.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/2/12.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "AddressModel.h"
  9. @implementation AddressModel
  10. -(instancetype)initWithDic:(NSDictionary *)dic{
  11. self = [super init];
  12. if (self) {
  13. self.name = minstr([dic valueForKey:@"name"]);//姓名
  14. self.country = minstr([dic valueForKey:@"country"]);//国家
  15. self.province = minstr([dic valueForKey:@"province"]);//省
  16. self.city = minstr([dic valueForKey:@"city"]);//市
  17. self.area = minstr([dic valueForKey:@"area"]);//区
  18. self.address = minstr([dic valueForKey:@"address"]);//详细地址
  19. self.country_code = minstr([dic valueForKey:@"country_code"]);//国家代码
  20. self.phone = minstr([dic valueForKey:@"phone"]);//电话
  21. self.is_default = minstr([dic valueForKey:@"is_default"]);//是否默认
  22. self.idStr = minstr([dic valueForKey:@"id"]);
  23. }
  24. return self;
  25. }
  26. +(instancetype)modelWithDic:(NSDictionary *)subdic{
  27. AddressModel *model = [[AddressModel alloc]initWithDic:subdic];
  28. return model;
  29. }
  30. @end