Skip to content

Commit b386fc2

Browse files
committed
新增文件~
1 parent 80bf21d commit b386fc2

5 files changed

Lines changed: 75 additions & 20 deletions

File tree

Coding_iOS/Controllers/AllSearchDisplayVC.m

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
#import "TweetSearchCell.h"
3333

3434
// nav--------
35-
#import "NProjectViewController.h"
3635
#import "TweetDetailViewController.h"
37-
#import "FileViewController.h"
38-
#import "ProjectSquareViewController.h"
3936

4037
@interface AllSearchDisplayVC () <UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource,UIScrollViewDelegate>
4138

@@ -307,14 +304,7 @@ - (void)didClickedHistory:(UIGestureRecognizer *)sender {
307304

308305
#pragma mark -- goVC
309306
- (void)goToProject:(Project *)project{
310-
NProjectViewController *vc = [[NProjectViewController alloc] init];
311-
312-
Project *projectCopy=[project copy];
313-
projectCopy.owner_user_name=[[[[[projectCopy project_path] componentsSeparatedByString:@"/p"] firstObject] componentsSeparatedByString:@"u/"] lastObject];
314-
projectCopy.name=[NSString getStr:project.name removeEmphasize:@"em"];
315-
projectCopy.description_mine=[NSString getStr:project.description_mine removeEmphasize:@"em"];
316-
317-
vc.myProject = projectCopy;
307+
UIViewController *vc = [BaseViewController analyseVCFromLinkStr:project.project_path];
318308
[self.parentVC.navigationController pushViewController:vc animated:TRUE];
319309
}
320310

@@ -325,17 +315,11 @@ -(void)goToTweet:(Tweet *)tweet{
325315
}
326316

327317
- (void)goToFileVC:(ProjectFile *)file{
328-
FileViewController *vc = [FileViewController vcWithFile:file andVersion:nil];
329-
[self.parentVC.navigationController pushViewController:vc animated:YES];
330-
}
331-
332-
- (void)goToProjectSquareVC{
333-
ProjectSquareViewController *vc=[ProjectSquareViewController new];
318+
UIViewController *vc = [BaseViewController analyseVCFromLinkStr:file.path];
334319
[self.parentVC.navigationController pushViewController:vc animated:YES];
335320
}
336321

337322

338-
339323
#pragma mark -
340324
#pragma mark Search Data Request
341325

Coding_iOS/Models/Project.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ -(id)copyWithZone:(NSZone*)zone {
5050
person.created_at = [_created_at copy];
5151
person.updated_at = [_updated_at copy];
5252
person.project_path=[_project_path copy];
53+
person.owner=[_owner copy];
5354
return person;
5455
}
5556

Coding_iOS/Models/ProjectFile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ typedef NS_ENUM(NSInteger, DownloadState){
2121

2222
@interface ProjectFile : NSObject
2323
@property (readwrite, nonatomic, strong) NSDate *created_at, *updated_at;
24-
@property (readwrite, nonatomic, strong) NSNumber *file_id, *owner_id, *parent_id, *type, *current_user_role_id, *size, *project_id, *number;
25-
@property (readwrite, nonatomic, strong) NSString *name, *fileType, *owner_preview, *preview, *storage_key, *storage_type, *title, *share_url;
24+
@property (readwrite, nonatomic, strong) NSNumber *id,*file_id, *owner_id, *parent_id, *type, *current_user_role_id, *size, *project_id, *number;
25+
@property (readwrite, nonatomic, strong) NSString *name, *fileType, *owner_preview, *preview, *storage_key, *storage_type, *title, *share_url,*path;
2626
@property (readwrite, nonatomic, strong) User *owner;
2727
@property (strong, nonatomic, readonly) NSString *diskFileName;
2828

Coding_iOS/Models/ProjectFile.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@ @interface ProjectFile ()
1616

1717
@implementation ProjectFile
1818

19+
-(id)copyWithZone:(NSZone*)zone {
20+
ProjectFile *file = [[[self class] allocWithZone:zone] init];
21+
file.project_owner_name = [_project_owner_name copy];
22+
file.project_name = [_project_name copy];
23+
file.diskFileName = [_diskFileName copy];
24+
file.owner = [_owner copy];
25+
file.share_url = [_share_url copy];
26+
file.title = [_title copy];
27+
file.storage_type = [_storage_type copy];
28+
file.storage_key = [_storage_key copy];
29+
file.preview = [_preview copy];
30+
file.owner_preview = [_owner_preview copy];
31+
file.fileType = [_fileType copy];
32+
file.name = [_name copy];
33+
file.number = [_number copy];
34+
file.project_id = [_project_id copy];
35+
file.size = [_size copy];
36+
file.current_user_role_id = [_current_user_role_id copy];
37+
file.type = [_type copy];
38+
file.parent_id = [_parent_id copy];
39+
file.owner_id = [_owner_id copy];
40+
file.file_id = [_file_id copy];
41+
file.created_at = [_created_at copy];
42+
file.updated_at = [_updated_at copy];
43+
file.id=[_id copy];
44+
file.path=[_path copy];
45+
return file;
46+
}
47+
48+
1949
+(ProjectFile *)fileWithFileId:(NSNumber *)fileId andProjectId:(NSNumber *)project_id{
2050
ProjectFile *file = [[ProjectFile alloc] init];
2151
file.file_id = fileId;

Coding_iOS/Models/User.m

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,46 @@
99
#import "User.h"
1010

1111
@implementation User
12+
13+
14+
-(id)copyWithZone:(NSZone*)zone {
15+
User *user = [[[self class] allocWithZone:zone] init];
16+
user.avatar = [_avatar copy];
17+
user.name = [_name copy];
18+
user.global_key = [_global_key copy];
19+
user.path = [_path copy];
20+
user.slogan = [_slogan copy];
21+
user.company = [_company copy];
22+
user.tags_str = [_tags_str copy];
23+
user.tags = [_tags copy];
24+
user.location = [_location copy];
25+
user.job_str = [_job_str copy];
26+
user.job = [_job copy];
27+
user.email = [_email copy];
28+
user.birthday = [_birthday copy];
29+
user.pinyinName = [_pinyinName copy];
30+
user.curPassword = [_curPassword copy];
31+
user.resetPassword = [_resetPassword copy];
32+
user.resetPasswordConfirm = [_resetPasswordConfirm copy];
33+
user.phone = [_phone copy];
34+
user.introduction = [_introduction copy];
35+
user.id = [_id copy];
36+
user.sex = [_sex copy];
37+
user.follow = [_follow copy];
38+
user.followed = [_followed copy];
39+
user.fans_count = [_fans_count copy];
40+
user.follows_count = [_follows_count copy];
41+
user.tweets_count = [_tweets_count copy];
42+
user.status = [_status copy];
43+
user.tweets_count = [_tweets_count copy];
44+
user.last_logined_at = [_last_logined_at copy];
45+
user.last_activity_at = [_last_activity_at copy];
46+
user.created_at = [_created_at copy];
47+
user.updated_at = [_updated_at copy];
48+
return user;
49+
}
50+
51+
1252
+ (User *)userWithGlobalKey:(NSString *)global_key{
1353
User *curUser = [[User alloc] init];
1454
curUser.global_key = global_key;

0 commit comments

Comments
 (0)