-
Notifications
You must be signed in to change notification settings - Fork 75
/
DOUAlbum.m
120 lines (86 loc) · 2.07 KB
/
DOUAlbum.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
// DOUAlbum.m
// DoubanApiClient
//
// Created by Lin GUO on 4/26/12.
// Copyright (c) 2012 Douban Inc. All rights reserved.
//
#import "DOUAlbum.h"
#import "DOUObject+Utils.h"
#import "DOUUser.h"
@implementation DOUAlbum
@dynamic identifier;
@dynamic alt;
@dynamic title;
@dynamic desc;
@dynamic privacy;
@dynamic createTimeStr;
@dynamic createTime;
@dynamic updateTimeStr;
@dynamic updateTime;
@dynamic size;
@dynamic recsCount;
@dynamic likedCount;
@dynamic icon;
@dynamic thumb;
@dynamic cover;
@dynamic image;
@dynamic liked;
@dynamic author;
- (NSString *)identifier {
return [self.dictionary objectForKey:@"id"];
}
- (NSString *)alt {
return [self.dictionary objectForKey:@"alt"];
}
- (NSString *)title {
return [self.dictionary objectForKey:@"title"];
}
- (NSString *)desc {
return [self.dictionary objectForKey:@"desc"];
}
- (NSString *)privacy {
return [self.dictionary objectForKey:@"privacy"];
}
- (NSString *)createTimeStr {
return [self.dictionary objectForKey:@"created"];
}
- (NSDate *)createTime {
return [[self class] dateOfString:self.createTimeStr];
}
- (NSString *)updateTimeStr {
return [self.dictionary objectForKey:@"updated"];
}
- (NSDate *)updateTime {
return [[self class] dateOfString:self.updateTimeStr];
}
- (NSInteger)recsCount {
return [[self.dictionary objectForKey:@"recs_count"] integerValue];
}
- (NSInteger)likedCount {
return [[self.dictionary objectForKey:@"liked_count"] integerValue];
}
- (NSInteger)size {
return [[self.dictionary objectForKey:@"size"] integerValue];
}
- (NSString *)icon {
return [self.dictionary objectForKey:@"icon"];
}
- (NSString *)thumb {
return [self.dictionary objectForKey:@"thumb"];
}
- (NSString *)cover {
return [self.dictionary objectForKey:@"cover"];
}
- (NSString *)image {
return [self.dictionary objectForKey:@"image"];
}
- (DOUUser *)author {
NSDictionary *dic = [self.dictionary objectForKey:@"author"];
DOUUser *people = [DOUUser objectWithDictionary:dic];
return people;
}
- (BOOL)liked {
return [[self.dictionary objectForKey:@"liked"] boolValue];
}
@end