Skip to content

Commit e23a573

Browse files
author
yangsen
committed
support multi region
1 parent 3096342 commit e23a573

16 files changed

+312
-171
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.qiniu.storage;
2+
3+
class ApiType {
4+
5+
static final int ActionTypeNone = 0;
6+
static final int ActionTypeUploadByForm = 1;
7+
static final int ActionTypeUploadByResumeV1 = 2;
8+
static final int ActionTypeUploadByResumeV2 = 3;
9+
10+
static String actionTypeString(int actionType) {
11+
String type = "";
12+
switch (actionType) {
13+
case ActionTypeUploadByForm:
14+
type = "form";
15+
break;
16+
case ActionTypeUploadByResumeV1:
17+
type = "resume-v1";
18+
break;
19+
case ActionTypeUploadByResumeV2:
20+
type = "resume-v2";
21+
break;
22+
default:
23+
break;
24+
}
25+
return type;
26+
}
27+
28+
static String[] apisWithActionType(int actionType) {
29+
String[] apis = null;
30+
switch (actionType) {
31+
case ActionTypeUploadByForm:
32+
apis = new String[]{"up.formupload"};
33+
break;
34+
case ActionTypeUploadByResumeV1:
35+
apis = new String[]{"up.mkblk", "up.bput", "up.mkfile"};
36+
break;
37+
case ActionTypeUploadByResumeV2:
38+
apis = new String[]{"up.initparts", "up.uploadpart", "up.completeparts"};
39+
break;
40+
default:
41+
break;
42+
}
43+
return apis;
44+
}
45+
}

0 commit comments

Comments
 (0)