//
//  HWVersionModel.m
//  VclustersGemini
//
//  Created by 余衡武 on 2020/9/7.
//  Copyright © 2020 APPLE. All rights reserved.
//

#import "HWVersionModel.h"

@implementation HWVersionModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"versionNumber" : @"newVersion",
             @"versionInfo" : @"newVersionInfo"
             
    };
}

#pragma mark - 归档解档
- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:self.downUrl forKey:@"downUrl"];
    [aCoder encodeObject:self.versionNumber forKey:@"versionNumber"];
    [aCoder encodeObject:self.versionInfo forKey:@"versionInfo"];
    [aCoder encodeObject:self.fileSize forKey:@"fileSize"];
    [aCoder encodeObject:[NSNumber numberWithDouble:self.necessary] forKey:@"necessary"];
}

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self != nil) {
        
        [self setDownUrl:[aDecoder decodeObjectForKey:@"downUrl"]];
        [self setVersionNumber:[aDecoder decodeObjectForKey:@"versionNumber"]];
        [self setVersionInfo:[aDecoder decodeObjectForKey:@"versionInfo"]];
        [self setFileSize:[aDecoder decodeObjectForKey:@"fileSize"]];
        [self setNecessary:[[aDecoder decodeObjectForKey:@"fileStatus"] intValue]];
    }
    
    return self;
}

@end
