Skip to content

Commit

Permalink
upload support acc (qiniu#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn authored Jun 24, 2024
1 parent ccdefb2 commit 350f2d0
Show file tree
Hide file tree
Showing 24 changed files with 379 additions and 74 deletions.
1 change: 0 additions & 1 deletion .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
grep -qF "## ${RELEASE_VERSION}" CHANGELOG.md
grep -qF "\"${RELEASE_VERSION}\"" README.md
grep -qF "static NSString *const kQiniuVersion = @\"${RELEASE_VERSION}\";" QiniuSDK/Utils/QNVersion.h
grep -qF "<string>${RELEASE_VERSION}</string>" QiniuSDK/info.plist
1 change: 1 addition & 0 deletions QiniuDemo/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target "QiniuDemo" do
# pod 'Qiniu', '~> 7.4.0'
# pod 'Qiniu', '7.1.7'
pod 'Qiniu',:path => '../'
pod 'HappyDNS',:path => '../../happy-dns-objc'
end

target "QiniuDemoTests" do
Expand Down
12 changes: 5 additions & 7 deletions QiniuDemo/QiniuDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
26F62ADDD5B6306E978C9A3F /* libPods-QiniuDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CB2139715DD7B6FD5B146E /* libPods-QiniuDemoTests.a */; };
4545D3142BAD7D0C00932C3F /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 4545D3132BAD7D0C00932C3F /* PrivacyInfo.xcprivacy */; };
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */ = {isa = PBXBuildFile; fileRef = 4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */; };
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */ = {isa = PBXBuildFile; fileRef = 45E6080829ADD57100634200 /* UploadResource_1G.zip */; };
93D230241C86D7F700434F6D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230231C86D7F700434F6D /* main.m */; };
Expand Down Expand Up @@ -43,7 +42,6 @@
14CB2139715DD7B6FD5B146E /* libPods-QiniuDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
24EE530BBB100BED89B08A3D /* Pods-QiniuDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDemo/Pods-QiniuDemo.release.xcconfig"; sourceTree = "<group>"; };
3189882026469145003CCA68 /* QiniuDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = QiniuDemo.entitlements; sourceTree = "<group>"; };
4545D3132BAD7D0C00932C3F /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_14M.zip; sourceTree = "<group>"; };
4561F02F28D9AB090098A697 /* Configure.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Configure.h; sourceTree = "<group>"; };
45E6080829ADD57100634200 /* UploadResource_1G.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_1G.zip; sourceTree = "<group>"; };
Expand Down Expand Up @@ -171,7 +169,6 @@
93D230301C86D7F700434F6D /* LaunchScreen.storyboard */,
93D230331C86D7F700434F6D /* Info.plist */,
93D230221C86D7F700434F6D /* Supporting Files */,
4545D3132BAD7D0C00932C3F /* PrivacyInfo.xcprivacy */,
);
path = QiniuDemo;
sourceTree = "<group>";
Expand Down Expand Up @@ -272,7 +269,7 @@
TargetAttributes = {
93D2301E1C86D7F700434F6D = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = X2US9XXC6H;
DevelopmentTeam = W2TP34G2MM;
};
93D230371C86D7F700434F6D = {
CreatedOnToolsVersion = 7.2;
Expand Down Expand Up @@ -309,7 +306,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4545D3142BAD7D0C00932C3F /* PrivacyInfo.xcprivacy in Resources */,
93D230321C86D7F700434F6D /* LaunchScreen.storyboard in Resources */,
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */,
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */,
Expand Down Expand Up @@ -342,10 +338,12 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-QiniuDemo/Pods-QiniuDemo-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS/HappyDNS.privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/Qiniu/Qiniu.privacy.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/HappyDNS.privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Qiniu.privacy.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -566,7 +564,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = QiniuDemo/QiniuDemo.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = X2US9XXC6H;
DEVELOPMENT_TEAM = W2TP34G2MM;
INFOPLIST_FILE = QiniuDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -587,7 +585,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = QiniuDemo/QiniuDemo.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = X2US9XXC6H;
DEVELOPMENT_TEAM = W2TP34G2MM;
INFOPLIST_FILE = QiniuDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
14 changes: 10 additions & 4 deletions QiniuDemo/QiniuDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ - (IBAction)uploadAction:(UIButton *)sender {
path = [[NSBundle mainBundle] pathForResource:@"UploadResource_14M.zip" ofType:nil];
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_9M.zip" ofType:nil];
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_49M.zip" ofType:nil];
path = [[NSBundle mainBundle] pathForResource:@"UploadResource_1G.zip" ofType:nil];
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_1G.zip" ofType:nil];

// NSFileManager *manager = [NSFileManager defaultManager];
// NSURL *desktopUrl = [manager URLsForDirectory:NSDesktopDirectory inDomains:NSUserDomainMask].firstObject;
Expand Down Expand Up @@ -139,6 +139,7 @@ - (void)uploadImageToQNFilePath:(NSString *)filePath complete:(dispatch_block_t)
NSString *key = [NSString stringWithFormat:@"iOS_Demo_%@", [NSDate date]];
key = @"iOS-Test";
self.token = YourToken;
self.token = @"5cJEzNSnh3PjOHZR_E0u1HCkXw4Bw1ZSuWQI9ufz:-ul1AJ8Fvpc7WhtpVT91Pvdfreo=:eyJzY29wZSI6InpvbmUwLXNwYWNlIiwiZGVhZGxpbmUiOjM0MzM3NDYyNTl9";


QNConfiguration *configuration = [QNConfiguration build:^(QNConfigurationBuilder *builder) {
Expand All @@ -147,11 +148,16 @@ - (void)uploadImageToQNFilePath:(NSString *)filePath complete:(dispatch_block_t)
// builder.useHttps = NO;

builder.useConcurrentResumeUpload = false;
builder.concurrentTaskCount = 10;
builder.concurrentTaskCount = 2;
builder.resumeUploadVersion = QNResumeUploadVersionV2;
builder.putThreshold = 4*1024*1024;
builder.chunkSize = 1*1024*1024;
// builder.zone = [[QNFixedZone alloc] initWithUpDomainList:@[kUploadFixHost00, kUploadFixHost01]];
builder.chunkSize = 5*1024*1024;
builder.accelerateUploading = true;
// builder.zone = [[QNFixedZone alloc] initWithAccUpDomainList:@[@"zone0-space.kodo-accelerate.cn-east-1.qiniucs.com"]
// upList:@[kUploadFixHost00]
// oldUpList:@[]
// regionId:@"custom"];
// [[QNFixedZone alloc] initWithUpDomainList:@[kUploadFixHost00, kUploadFixHost01]];
NSString *recorderPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSLog(@"== record path:%@", recorderPath);
builder.recorder = [QNFileRecorder fileRecorderWithFolder:recorderPath error:nil];
Expand Down
Loading

0 comments on commit 350f2d0

Please sign in to comment.