forked from coding/Coding-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectFolders.m
More file actions
executable file
·56 lines (50 loc) · 1.38 KB
/
ProjectFolders.m
File metadata and controls
executable file
·56 lines (50 loc) · 1.38 KB
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
//
// ProjectFolders.m
// Coding_iOS
//
// Created by Ease on 14/11/13.
// Copyright (c) 2014年 Coding. All rights reserved.
//
#import "ProjectFolders.h"
@implementation ProjectFolders
- (instancetype)init
{
self = [super init];
if (self) {
_propertyArrayMap = [NSDictionary dictionaryWithObjectsAndKeys:
@"ProjectFolder", @"list", nil];
_list = [NSMutableArray array];
_isLoading = NO;
}
return self;
}
+ (ProjectFolders *)emptyFolders{
return [[ProjectFolders alloc] init];
}
- (BOOL)isEmpty{
return (!self.list || self.list.count <= 0);
}
- (ProjectFolder *)hasFolderWithId:(NSNumber *)file_id{
if (!file_id || [self isEmpty]) {
return nil;
}
ProjectFolder *resultFolder;
for (ProjectFolder *folder in self.list) {
resultFolder = [folder hasFolderWithId:file_id];
if (resultFolder) {
return resultFolder;
}
}
return nil;
}
- (NSString *)toFoldersPathWithObj:(NSNumber *)project_id{
return [NSString stringWithFormat:@"api/project/%@/all_folders", project_id.stringValue];
}
- (NSDictionary *)toFoldersParams{
return @{@"page": @"1",
@"pageSize": @"9999"};
}
- (NSString *)toFoldersCountPathWithObj:(NSNumber *)project_id{
return [NSString stringWithFormat:@"api/project/%@/folders/all_file_count", project_id.stringValue];
}
@end