Update objc client.

* Add test cases for deserialization.
* Pretty print model infomation.
This commit is contained in:
geekerzp
2015-07-22 17:45:31 +08:00
parent 37dbd6e4cd
commit f9ad16e7aa
11 changed files with 222 additions and 81 deletions

View File

@@ -1,7 +1,7 @@
#import "SWGCategory.h"
@implementation SWGCategory
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }];
@@ -19,4 +19,8 @@
}
}
- (NSString *)description {
return [[self toDictionary] description];
}
@end

View File

@@ -1,7 +1,7 @@
#import "SWGOrder.h"
@implementation SWGOrder
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }];
@@ -19,4 +19,8 @@
}
}
- (NSString *)description {
return [[self toDictionary] description];
}
@end

View File

@@ -1,7 +1,7 @@
#import "SWGPet.h"
@implementation SWGPet
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }];
@@ -19,4 +19,8 @@
}
}
- (NSString *)description {
return [[self toDictionary] description];
}
@end

View File

@@ -1,7 +1,7 @@
#import "SWGTag.h"
@implementation SWGTag
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }];
@@ -19,4 +19,8 @@
}
}
- (NSString *)description {
return [[self toDictionary] description];
}
@end

View File

@@ -1,7 +1,7 @@
#import "SWGUser.h"
@implementation SWGUser
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }];
@@ -19,4 +19,8 @@
}
}
- (NSString *)description {
return [[self toDictionary] description];
}
@end