//
//  JDJSONModel.m
//  JasonDevelop
//
//  Created by Jason Lee on 7/10/15.
//  Copyright (c) 2015 ntels. All rights reserved.
//

#import "JDJSONModel.h"
#import "CommonUtil.h"

@implementation JDJSONModel

+ (JSONKeyMapper *)keyMapper {
    return [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
}

+ (BOOL)propertyIsOptional:(NSString *)propertyName {
    return YES;
}

@end

@implementation MobileDeviceModel

- (NSString *)createDatetime {
    NSDateFormatter *df = [CommonUtil dateFormatter];
    [df setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
    [df setDateFormat:@"yyyy-MM-dd"];
    NSDate *utcDate = [df dateFromString:_createDatetime];
    
    NSDateFormatter* df_local = [[CommonUtil dateFormatter] copy];
    [df_local setTimeZone:[NSTimeZone systemTimeZone]];
    [df_local setDateFormat:@"yyyy년 MM월 dd일"];
    return [df_local stringFromDate:utcDate];
}

@end

@implementation JDErrorModel

+ (JSONKeyMapper *)keyMapper {
    return [[JSONKeyMapper alloc] initWithDictionary:@{@"err_code": @"errorCode",
                                                       @"err_msg" : @"errorMessage",
                                                       @"description": @"errorDescription",
                                                       @"nickname": @"nickname",
                                                       @"device_list": @"deviceList",
                                                       @"error_count": @"errorCount"}];
}

@end


@implementation CommonCode

@end

@implementation CommonCodeList

@end


@implementation QRAuthModel

@end