//
//  ZYJQNRecord.m
//  ZYJHappyDNS
//
//  Created by bailong on 15/6/23.
//  Copyright (c) 2015年 Qiniu Cloud Storage. All rights reserved.
//

#import "ZYJQNRecord.h"

const int kZYJQNTypeA = 1;
const int kZYJQNTypeAAAA = 28;
const int kZYJQNTypeCname = 5;
const int kZYJQNTypeTXT = 16;

@implementation ZYJQNRecord
- (instancetype)init:(NSString *)value
                 ttl:(int)ttl
                type:(int)type
              source:(ZYJQNRecordSource)source {
    if (self = [super init]) {
        _value = value;
        _type = type;
        _ttl = ttl;
        _source = source;
        _timeStamp = [[NSDate date] timeIntervalSince1970];
    }
    return self;
}

- (BOOL)expired:(long long)time {
    return time > _timeStamp + _ttl;
}

@end
