@@ -109,9 +109,11 @@ - (NSString *)toDoLikePath{
109
109
}
110
110
111
111
- (NSString *)toDoCommentPath {
112
- NSString *doCommentPath;
113
- doCommentPath = [NSString stringWithFormat: @" api/tweet/%d /comment" , self .id .intValue];
114
- return doCommentPath;
112
+ if (self.project_id ) {
113
+ return [NSString stringWithFormat: @" api/project/%@ /tweet/%@ /comment" , self .project_id.stringValue, self .id .stringValue];
114
+ }else {
115
+ return [NSString stringWithFormat: @" api/tweet/%d /comment" , self .id .intValue];
116
+ }
115
117
}
116
118
- (NSDictionary *)toDoCommentParams {
117
119
return @{@" content" : [self .nextCommentStr aliasedString ]};
@@ -124,21 +126,37 @@ - (NSDictionary *)toLikersParams{
124
126
@" pageSize" : [NSNumber numberWithInteger: 500 ]};
125
127
}
126
128
- (NSString *)toCommentsPath {
127
- return [NSString stringWithFormat: @" api/tweet/%d /comments" , _id.intValue];
129
+ NSString *path;
130
+ if (self.project_id ) {
131
+ path = [NSString stringWithFormat: @" api/project/%@ /tweet/%@ /comments" , self .project_id.stringValue, self .id .stringValue];
132
+ }else {
133
+ path = [NSString stringWithFormat: @" api/tweet/%d /comments" , _id.intValue];
134
+ }
135
+ return path;
128
136
}
129
137
- (NSDictionary *)toCommentsParams {
130
138
return @{@" page" : [NSNumber numberWithInteger: 1 ],
131
139
@" pageSize" : [NSNumber numberWithInteger: 500 ]};
132
140
}
133
141
- (NSString *)toDeletePath {
134
- return [NSString stringWithFormat: @" api/tweet/%d " , self .id .intValue];
142
+ if (self.project_id ) {
143
+ return [NSString stringWithFormat: @" api/project/%@ /tweet/%@ " , self .project_id.stringValue, self .id .stringValue];
144
+ }else {
145
+ return [NSString stringWithFormat: @" api/tweet/%d " , self .id .intValue];
146
+ }
135
147
}
136
148
- (NSString *)toDetailPath {
137
- if (self.user_global_key && self.pp_id ) {
138
- return [NSString stringWithFormat: @" api/tweet/%@ /%@ " , self .user_global_key, self .pp_id];
149
+ NSString *path;
150
+ if (self.project_id ) {
151
+ path = [NSString stringWithFormat: @" api/project/%@ /tweet/%@ " , self .project_id.stringValue, self .id .stringValue];
152
+ }else if (self.project ){
153
+ // 需要先去获取project_id
154
+ }else if (self.user_global_key ) {
155
+ path = [NSString stringWithFormat: @" api/tweet/%@ /%@ " , self .user_global_key, self .id .stringValue];
139
156
}else {
140
- return [NSString stringWithFormat: @" api/tweet/%@ /%@ " , self .owner.global_key, self .id .stringValue];
157
+ path = [NSString stringWithFormat: @" api/tweet/%@ /%@ " , self .owner.global_key, self .id .stringValue];
141
158
}
159
+ return path;
142
160
}
143
161
144
162
+(Tweet *)tweetForSend {
@@ -198,8 +216,14 @@ + (void)deleteSendData{
198
216
199
217
+(Tweet *)tweetWithGlobalKey : (NSString *)user_global_key andPPID : (NSString *)pp_id {
200
218
Tweet *tweet = [[Tweet alloc ] init ];
219
+ tweet.id = [NSNumber numberWithInteger: pp_id.integerValue];
201
220
tweet.user_global_key = user_global_key;
202
- tweet.pp_id = pp_id;
221
+ return tweet;
222
+ }
223
+ +(Tweet *)tweetInProject : (Project *)project andPPID : (NSString *)pp_id {
224
+ Tweet *tweet = [[Tweet alloc ] init ];
225
+ tweet.id = [NSNumber numberWithInteger: pp_id.integerValue];
226
+ tweet.project = project;
203
227
return tweet;
204
228
}
205
229
@@ -251,7 +275,13 @@ - (void)deleteComment:(Comment *)comment{
251
275
}
252
276
253
277
- (NSString *)toShareLinkStr {
254
- return [NSString stringWithFormat: @" %@ u/%@ /pp/%@ " , kBaseUrlStr_Phone , _owner.global_key, _id];
278
+ NSString *shareLinkStr;
279
+ if (_project) {
280
+ shareLinkStr = [NSString stringWithFormat: @" %@ u/%@ /p/%@ ?pp=%@ " , [NSObject baseURLStr ], _project.owner_user_name, _project.name, _id.stringValue];
281
+ }else {
282
+ shareLinkStr = [NSString stringWithFormat: @" %@ u/%@ /pp/%@ " , kBaseUrlStr_Phone , _owner.global_key, _id];
283
+ }
284
+ return shareLinkStr;
255
285
}
256
286
257
287
#pragma mark ALAsset
0 commit comments