This commit is contained in:
Yao
2024-12-25 09:41:16 +08:00
parent 654d456c7d
commit 33a7b58a49
33 changed files with 274 additions and 214 deletions

View File

@@ -23,6 +23,7 @@ NSString *const kConfigDataWsUrl = @"wsUrl";
NSString *const kConfigDataApkUrl = @"apkUrl";
NSString *const kConfigDataDownloadUrl = @"downloadUrl";
NSString *const kConfigDataIsUse = @"isUse";
NSString *const kConfigDatalinkConfig = @"linkConfig";
@interface ConfigData ()
@@ -48,6 +49,7 @@ NSString *const kConfigDataIsUse = @"isUse";
@synthesize apkUrl = _apkUrl;
@synthesize downloadUrl = _downloadUrl;
@synthesize isUse = _isUse;
@synthesize linkConfig = _linkConfig;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict {
return [[self alloc] initWithDictionary:dict];
@@ -74,8 +76,7 @@ NSString *const kConfigDataIsUse = @"isUse";
self.apkUrl = [self objectOrNilForKey:kConfigDataApkUrl fromDictionary:dict];
self.downloadUrl = [self objectOrNilForKey:kConfigDataDownloadUrl fromDictionary:dict];
self.isUse = [[self objectOrNilForKey:kConfigDataIsUse fromDictionary:dict] intValue];
}
self.linkConfig = [self objectOrNilForKey:kConfigDatalinkConfig fromDictionary:dict]; }
return self;
}
@@ -96,6 +97,7 @@ NSString *const kConfigDataIsUse = @"isUse";
[mutableDict setValue:self.wsUrl forKey:kConfigDataWsUrl];
[mutableDict setValue:self.apkUrl forKey:kConfigDataApkUrl];
[mutableDict setValue:self.downloadUrl forKey:kConfigDataDownloadUrl];
[mutableDict setValue:self.linkConfig forKey:kConfigDataDownloadUrl];
[mutableDict setValue:[NSNumber numberWithInteger:self.isUse] forKey:kConfigDataIsUse];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
@@ -129,6 +131,7 @@ NSString *const kConfigDataIsUse = @"isUse";
self.wsUrl = [aDecoder decodeObjectForKey:kConfigDataWsUrl];
self.apkUrl = [aDecoder decodeObjectForKey:kConfigDataApkUrl];
self.downloadUrl = [aDecoder decodeObjectForKey:kConfigDataDownloadUrl];
self.linkConfig = [aDecoder decodeObjectForKey:kConfigDatalinkConfig];
self.isUse = [aDecoder decodeIntegerForKey:kConfigDataIsUse];
return self;
}
@@ -148,6 +151,7 @@ NSString *const kConfigDataIsUse = @"isUse";
[aCoder encodeInteger:_noticeApplyMode forKey:kConfigDataNoticeApplyMode];
[aCoder encodeObject:_wsUrl forKey:kConfigDataWsUrl];
[aCoder encodeObject:_apkUrl forKey:kConfigDataApkUrl];
[aCoder encodeObject:_linkConfig forKey:kConfigDatalinkConfig];
[aCoder encodeObject:_downloadUrl forKey:kConfigDataDownloadUrl];
[aCoder encodeInteger:_isUse forKey:kConfigDataIsUse];
}
@@ -169,6 +173,7 @@ NSString *const kConfigDataIsUse = @"isUse";
copy.noticeApplyMode = self.noticeApplyMode;
copy.wsUrl = [self.wsUrl copyWithZone:zone];
copy.apkUrl = [self.apkUrl copyWithZone:zone];
copy.linkConfig = [self.linkConfig copyWithZone:zone];
copy.downloadUrl = [self.downloadUrl copyWithZone:zone];
copy.isUse = self.isUse;
}