mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-03 17:55:10 +08:00
44 lines
827 B
Objective-C
44 lines
827 B
Objective-C
//
|
|
// DBTopic.m
|
|
// DiscussionBoard
|
|
//
|
|
// Created by Daniel Hammond on 1/7/11.
|
|
// Copyright 2011 Two Toasters. All rights reserved.
|
|
//
|
|
|
|
#import "DBTopic.h"
|
|
|
|
@implementation DBTopic
|
|
|
|
@dynamic topicID;
|
|
@dynamic name;
|
|
@dynamic userID;
|
|
@dynamic createdAt;
|
|
@dynamic updatedAt;
|
|
@dynamic username;
|
|
|
|
#pragma mark RKObjectMappable methods
|
|
|
|
+ (NSDictionary*)elementToPropertyMappings {
|
|
return [NSDictionary dictionaryWithKeysAndObjects:
|
|
@"id",@"topicID",
|
|
@"name",@"name",
|
|
@"user_id",@"userID",
|
|
@"created_at",@"createdAt",
|
|
@"updated_at",@"updatedAt",
|
|
@"user_login", @"username",
|
|
nil];
|
|
}
|
|
|
|
+ (NSString*)primaryKeyProperty {
|
|
return @"topicID";
|
|
}
|
|
|
|
- (id<RKRequestSerializable>)paramsForSerialization {
|
|
return [NSDictionary dictionaryWithObjectsAndKeys:
|
|
self.name, @"topic[name]", nil];
|
|
}
|
|
|
|
|
|
@end
|