瀏覽代碼

1.保存文件到盒子接口调试成功

huangxiaodong 1 年之前
父節點
當前提交
ce44c1cefe

+ 14 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -173,6 +173,10 @@
 		6B07AC2C2BF8D38F005C2B0E /* NASFileAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07AC2A2BF8D38F005C2B0E /* NASFileAudioModel.m */; };
 		6B07AC2D2BF8D38F005C2B0E /* NASFileAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07AC2A2BF8D38F005C2B0E /* NASFileAudioModel.m */; };
 		6B07AC2E2BF8D38F005C2B0E /* NASFileAudioModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07AC292BF8D38F005C2B0E /* NASFileAudioModel.h */; };
+		6B0D004B2BFE104B00F02719 /* queryOneShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */; };
+		6B0D004C2BFE104B00F02719 /* queryOneShareModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0D00492BFE104B00F02719 /* queryOneShareModel.h */; };
+		6B0D004D2BFE104B00F02719 /* queryOneShareModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0D00492BFE104B00F02719 /* queryOneShareModel.h */; };
+		6B0D004E2BFE104B00F02719 /* queryOneShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */; };
 		6B1CC2C62B677F3E00AD4217 /* extraMediaEventModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B1CC2C42B677F3D00AD4217 /* extraMediaEventModel.h */; };
 		6B1CC2C72B677F3E00AD4217 /* extraMediaEventModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B1CC2C52B677F3D00AD4217 /* extraMediaEventModel.m */; };
 		6B1CC2CA2B67A5FC00AD4217 /* USBInsertPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B1CC2C82B67A5FC00AD4217 /* USBInsertPopView.h */; };
@@ -1143,6 +1147,8 @@
 		6B07AC242BF85859005C2B0E /* ShareRecordModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareRecordModel.m; sourceTree = "<group>"; };
 		6B07AC292BF8D38F005C2B0E /* NASFileAudioModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NASFileAudioModel.h; sourceTree = "<group>"; };
 		6B07AC2A2BF8D38F005C2B0E /* NASFileAudioModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NASFileAudioModel.m; sourceTree = "<group>"; };
+		6B0D00492BFE104B00F02719 /* queryOneShareModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = queryOneShareModel.h; sourceTree = "<group>"; };
+		6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = queryOneShareModel.m; sourceTree = "<group>"; };
 		6B1CC2C42B677F3D00AD4217 /* extraMediaEventModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = extraMediaEventModel.h; sourceTree = "<group>"; };
 		6B1CC2C52B677F3D00AD4217 /* extraMediaEventModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = extraMediaEventModel.m; sourceTree = "<group>"; };
 		6B1CC2C82B67A5FC00AD4217 /* USBInsertPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = USBInsertPopView.h; sourceTree = "<group>"; };
@@ -2304,6 +2310,8 @@
 				6B7EA7AF2BF73DEB002D5CC2 /* addShareModel.m */,
 				6B07AC232BF85859005C2B0E /* ShareRecordModel.h */,
 				6B07AC242BF85859005C2B0E /* ShareRecordModel.m */,
+				6B0D00492BFE104B00F02719 /* queryOneShareModel.h */,
+				6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */,
 			);
 			path = model;
 			sourceTree = "<group>";
@@ -2795,6 +2803,7 @@
 				18FCE5332AD12FE00020F623 /* ConnectTestViewController.h in Headers */,
 				181E84F22A8F0A9B00292B96 /* HelpDownScrollView.h in Headers */,
 				6B2170882B1444CC00656670 /* allVersionView.h in Headers */,
+				6B0D004C2BFE104B00F02719 /* queryOneShareModel.h in Headers */,
 				6B45C50C2B5FA80E007E6911 /* diskListBgView.h in Headers */,
 				6B2170912B15BAE700656670 /* privacyModeViewController.h in Headers */,
 				6B1FBD3A2B467A8000926382 /* backupsFilerecordTableView.h in Headers */,
@@ -2957,6 +2966,7 @@
 				6BD506BB2B9576A4006E7CB0 /* ConnectTestViewController.h in Headers */,
 				6BD506BC2B9576A4006E7CB0 /* HelpDownScrollView.h in Headers */,
 				6BD506BD2B9576A4006E7CB0 /* allVersionView.h in Headers */,
+				6B0D004D2BFE104B00F02719 /* queryOneShareModel.h in Headers */,
 				6BD506BE2B9576A4006E7CB0 /* diskListBgView.h in Headers */,
 				6BD506BF2B9576A4006E7CB0 /* privacyModeViewController.h in Headers */,
 				6BD506C02B9576A4006E7CB0 /* backupsFilerecordTableView.h in Headers */,
@@ -3645,6 +3655,7 @@
 				6BD507B72B9576A4006E7CB0 /* ComontAlretViewController.m in Sources */,
 				6BD507B82B9576A4006E7CB0 /* AJPhotoGroupView.m in Sources */,
 				6BD507B92B9576A4006E7CB0 /* PlayerViewController+TouchPointXD.m in Sources */,
+				6B0D004E2BFE104B00F02719 /* queryOneShareModel.m in Sources */,
 				6BD507BA2B9576A4006E7CB0 /* uploadImageOrVideoViewController.m in Sources */,
 				6BD507BB2B9576A4006E7CB0 /* ForbidMenuTextField.m in Sources */,
 				6BD507BC2B9576A4006E7CB0 /* netWorkManager.m in Sources */,
@@ -3892,6 +3903,7 @@
 				18A909992ABC4A3300E6D2BE /* ComontAlretViewController.m in Sources */,
 				6B0581AE2AFCF57300D37290 /* AJPhotoGroupView.m in Sources */,
 				18FCE5402AD136670020F623 /* PlayerViewController+TouchPointXD.m in Sources */,
+				6B0D004B2BFE104B00F02719 /* queryOneShareModel.m in Sources */,
 				6B0581612AFCD0DF00D37290 /* uploadImageOrVideoViewController.m in Sources */,
 				18E5572C2A3C6127005CC84B /* ForbidMenuTextField.m in Sources */,
 				6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */,
@@ -4356,7 +4368,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 5;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -4437,7 +4449,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 5;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (

+ 167 - 1
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -33,6 +33,8 @@
 #import <TencentOpenAPI/QQApiInterface.h>
 #import <TencentOpenAPI/TencentOAuth.h>
 #import "NASMsgModel.h"
+#import "queryOneShareModel.h"
+
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate>
 @property(nonatomic, strong)   CalculatorViewController *calculatorVC;
@@ -950,6 +952,170 @@
 #pragma mark 分享页面唤醒APP
 - (void)shareAwakenAppBy:(NSString*)shareStr
 {
-    [[iToast makeText:shareStr] show];
+    //[[iToast makeText:shareStr] show];
+    
+    NSArray * paraArr = [shareStr componentsSeparatedByString:@"&"];
+    if(!paraArr || paraArr.count==0){
+        return;
+    }
+    
+    //type=save和download
+    NSString *type = nil;
+    NSString *fileIds = nil;
+    NSString *extractionCode = nil;
+    NSString *token = nil;
+    
+    for (NSString*objectStr in paraArr) {
+        if([objectStr rangeOfString:@"type"].location != NSNotFound){
+            NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
+            if(objectArr.count == 2){
+                type = objectArr.lastObject;
+                continue;
+            }
+        }
+        else if([objectStr rangeOfString:@"fileIds"].location != NSNotFound){
+            NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
+            if(objectArr.count == 2){
+                fileIds = objectArr.lastObject;
+                continue;
+            }
+        }
+        else if([objectStr rangeOfString:@"extractionCode"].location != NSNotFound){
+            NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
+            if(objectArr.count == 2){
+                extractionCode = objectArr.lastObject;
+                continue;
+            }
+        }
+        else if([objectStr rangeOfString:@"token"].location != NSNotFound){
+            NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
+            if(objectArr.count == 2){
+                token = objectArr.lastObject;
+                continue;
+            }
+        }
+    }
+    
+    if(!type || type.length ==0){
+        HLog(@"分享 type 获取错误");
+        return;
+    }
+    
+    if(!fileIds || fileIds.length ==0){
+        HLog(@"分享 fileIds 获取错误");
+        return;
+    }
+    
+    if(!token || token.length ==0){
+        HLog(@"分享 token 获取错误");
+        return;
+    }
+    
+    [self getShareOneFileListFunByToken:token withFileIds:fileIds withExtractionCode:extractionCode withType:type];
+}
+
+#pragma mark 分享信息重新获取
+- (void)getShareOneFileListFunByToken:(NSString*)token withFileIds:(NSString*)fileIds withExtractionCode:(NSString*)extractionCode withType:(NSString*)type
+{
+   
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+
+    fileIds = [fileIds stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    
+    NSData *jsonData = [fileIds dataUsingEncoding:NSUTF8StringEncoding];;
+    NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
+     
+    HLog(@"jsonArray:%@",jsonArray)
+    
+    if(!jsonArray){
+        return;
+    }
+    
+    [paraDict setValue:token forKey:@"token"];
+    [paraDict setValue:jsonArray forKey:@"fileIdList"];
+    [paraDict setValue:extractionCode forKey:@"extractionCode"];
+
+
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonPostCallBackCode:queryOneShareInfoFun Parameters:paraDict success:^(id  _Nonnull responseObject) {
+
+        queryOneShareModel*model = [[queryOneShareModel alloc] initWithDictionary:responseObject error:nil];
+        if(model && model.status == 0){
+            [weakSelf gotoVCByModel:model withType:type];
+        }
+        else{
+
+        }
+    } failure:^(NSError * _Nonnull error) {
+
+    }];
+}
+
+#pragma mark 跳转
+- (void)gotoVCByModel:(queryOneShareModel*)model withType:(NSString*)type
+{
+    if([type isEqualToString:@"save"]){
+        [self saveFileToBoxFunBy:model];
+    }
+    else if([type isEqualToString:@"download"]){
+        
+    }
+    
+    
+}
+
+#pragma mark 保存文件到盒子
+- (void)saveFileToBoxFunBy:(queryOneShareModel*)model
+{
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+    
+//    NSString *str1 = @"[";
+//    NSString *str2 = @"]";
+//    NSMutableString *dataStr = [NSMutableString new];
+    
+    NSMutableArray *pathArr = [NSMutableArray new];
+    
+    for (ShareFileDataModel*dataModel in model.data.fileListVOS){
+//        if(dataStr.length != 0){
+//            [dataStr appendString:@","];
+//        }
+//        [dataStr appendString:@"\""];
+//        [dataStr appendString:dataModel.fileUrl];
+//        [dataStr appendString:@"\""];
+        
+        [pathArr addObject:dataModel.fileUrl];
+    }
+    
+//    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@%@%@",str1,dataStr,str2];
+//    [paraDict setValue:totalStr forKey:@"urls"];
+    
+    if (pathArr) {
+        NSString *jsonStr = [iTools toJsonStrWithArray:pathArr];
+        if(jsonStr){
+            [paraDict setValue:jsonStr forKey:@"urls"];
+        }
+    }
+    
+    
+    NSString * boxSaveDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_box_save_default_path)];
+    
+    if(!boxSaveDefaultPath || boxSaveDefaultPath.length == 0){
+        boxSaveDefaultPath = Const_default_save_path;
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:boxSaveDefaultPath];
+    }
+    
+    [paraDict setValue:boxSaveDefaultPath forKey:@"savePath"];
+    
+    //KWeakSelf
+    [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"downFiles" Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        
+        SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
+        if(model && model.status == 0){
+            
+        }
+    } failure:^(NSError * _Nonnull error) {
+        
+    }];
 }
+
 @end

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/model/ShareRecordModel.h

@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @protocol ShareRecordListModel;
 @interface ShareRecordModel : SuperModel
-@property (nonatomic, strong) NSArray<ShareRecordListModel>* data;;
+@property (nonatomic, strong) NSArray<ShareRecordListModel>* data;
 @end
 
 NS_ASSUME_NONNULL_END

+ 18 - 0
创维盒子/双子星云手机/Class/Set/previewFile/model/queryOneShareModel.h

@@ -0,0 +1,18 @@
+//
+//  queryOneShareModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/22.
+//
+
+#import "SuperModel.h"
+#import "ShareRecordModel.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface queryOneShareModel : SuperModel
+@property (nonatomic, strong) ShareRecordListModel* data;
+@end
+
+NS_ASSUME_NONNULL_END

+ 12 - 0
创维盒子/双子星云手机/Class/Set/previewFile/model/queryOneShareModel.m

@@ -0,0 +1,12 @@
+//
+//  queryOneShareModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/22.
+//
+
+#import "queryOneShareModel.h"
+
+@implementation queryOneShareModel
+
+@end

+ 1 - 1
创维盒子/双子星云手机/netWork/newWorkInterface.h

@@ -96,7 +96,7 @@
 #define queryShareRecordFun  @"/box/share/info/queryByCondition"
 
 /*14 查询单个分享信息接口 POST请求
-输入参数 id 主键id
+输入参数 fileIdList 主键id
  输入参数 token 状态 token
  输入参数 extractionCode 提取码
  返回数据模型 */