Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
79 lines (70 loc) · 2.34 KB

File metadata and controls

executable file
·
79 lines (70 loc) · 2.34 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
//
// ProjectTopics.m
// Coding_iOS
//
// Created by 王 原闯 on 14-8-20.
// Copyright (c) 2014年 Coding. All rights reserved.
//
#import "ProjectTopics.h"
@implementation ProjectTopics
- (instancetype)init
{
self = [super init];
if (self) {
_propertyArrayMap = [NSDictionary dictionaryWithObjectsAndKeys:
@"ProjectTopic", @"list", nil];
_page = [NSNumber numberWithInteger:1];
_pageSize = [NSNumber numberWithInteger:20];
_labelID = [NSNumber numberWithInteger:0];
_canLoadMore = YES;
_isLoading = _willLoadMore = NO;
_queryType = TopicQueryTypeAll;
_labelType = LabelOrderTypeUpdate;
}
return self;
}
+ (ProjectTopics *)topicsWithPro:(Project *)project queryType:(TopicQueryType)type
{
ProjectTopics *topics = [[ProjectTopics alloc] init];
topics.project = project;
topics.queryType = type;
return topics;
}
- (NSDictionary *)toParams
{
NSDictionary *dict;
if (_labelID && [_labelID integerValue] > 0 ) {
dict = @{@"page" : (_willLoadMore? [NSNumber numberWithInteger:_page.intValue+1] : [NSNumber numberWithInteger:1]),
@"pageSize" : _pageSize,
@"type" : (_queryType == TopicQueryTypeAll ? @"all" : @"my"),
@"orderBy" : [NSNumber numberWithInteger:_labelType],
@"labelId" : _labelID
};
} else {
dict = @{@"page" : (_willLoadMore? [NSNumber numberWithInteger:_page.intValue+1] : [NSNumber numberWithInteger:1]),
@"pageSize" : _pageSize,
@"type" : (_queryType == TopicQueryTypeAll ? @"all" : @"my"),
@"orderBy" : [NSNumber numberWithInteger:_labelType]
};
}
return dict;
}
- (NSString *)toRequestPath
{
NSString *path;
path = [NSString stringWithFormat:@"api/user/%@/project/%@/topics/mobile", _project.owner_user_name, _project.name];
return path;
}
- (void)configWithTopics:(ProjectTopics *)resultA
{
self.page = resultA.page;
self.totalPage = resultA.totalPage;
self.totalRow = resultA.totalRow;
if (_willLoadMore) {
[self.list addObjectsFromArray:resultA.list];
}else{
self.list = [NSMutableArray arrayWithArray:resultA.list];
}
self.canLoadMore = self.page.intValue < self.totalPage.intValue;
}
@end
Morty Proxy This is a proxified and sanitized view of the page, visit original site.