Skip to content

Commit 01edc79

Browse files
author
YangSen-qn
committed
pfop
1 parent a070b0b commit 01edc79

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/main/java/com/qiniu/processing/OperationManager.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ public String pfop(String bucket, String key, String fops, String pipeline, bool
155155
public String pfop(String bucket, String key, String fops, String pipeline, String notifyURL, boolean force)
156156
throws QiniuException {
157157
StringMap params = new StringMap()
158-
.putNotEmpty("type", "1")
159158
.putNotEmpty("pipeline", pipeline)
160159
.putNotEmpty("notifyURL", notifyURL)
161160
.putWhen("force", 1, force);
@@ -176,10 +175,10 @@ public String pfop(String bucket, String key, String fops, String pipeline, Stri
176175
* @throws QiniuException 触发失败异常,包含错误响应等信息
177176
* <a href="http://developer.qiniu.com/dora/api/persistent-data-processing-pfop"> 相关链接 </a>
178177
*/
179-
public String pfop(String bucket, String key, String fops, String pipeline, String notifyURL, String type, boolean force)
178+
public String pfop(String bucket, String key, String fops, String pipeline, String notifyURL, Integer type, boolean force)
180179
throws QiniuException {
181180
StringMap params = new StringMap()
182-
.putNotEmpty("type", type)
181+
.putNotNull("type", type)
183182
.putNotEmpty("pipeline", pipeline)
184183
.putNotEmpty("notifyURL", notifyURL)
185184
.putWhen("force", 1, force);

src/main/java/com/qiniu/processing/OperationStatus.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class OperationStatus {
4545
* 0:非闲时任务
4646
* 1:显示任务
4747
*/
48-
public String type;
48+
public Integer type;
4949

5050
/**
5151
* 任务创建时间

src/main/java/com/qiniu/storage/Api.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ protected RequestBody get() {
10661066
}
10671067

10681068
final MultipartBody.Builder b = new MultipartBody.Builder();
1069-
if (StringUtils.isNullOrEmpty(name)) {
1069+
if (!StringUtils.isNullOrEmpty(name)) {
10701070
b.addFormDataPart(name, fileName, body);
10711071
}
10721072

src/test/java/test/com/qiniu/processing/PfopTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.qiniu.storage.Configuration;
99
import com.qiniu.storage.Region;
1010
import com.qiniu.util.Auth;
11-
import com.qiniu.util.StringMap;
1211
import com.qiniu.util.StringUtils;
1312
import com.qiniu.util.UrlSafeBase64;
1413
import org.junit.jupiter.api.Tag;
@@ -142,7 +141,7 @@ private void testPfopIsSuccess(String jobid) {
142141

143142
@Test
144143
@Tag("IntegrationTest")
145-
public void testPfopA() {
144+
void testPfopWithType() {
146145
try {
147146
Auth auth = TestConfig.testAuth;
148147
Map<String, Region> bucketKeyMap = new HashMap<String, Region>();
@@ -156,12 +155,13 @@ public void testPfopA() {
156155

157156
Configuration cfg = new Configuration(region);
158157
OperationManager operationManager = new OperationManager(auth, cfg);
159-
String jobID = operationManager.pfop(bucket, TestConfig.testMp4FileKey, "avinfo", "", "", "1", true);
158+
String jobID = operationManager.pfop(bucket, TestConfig.testMp4FileKey, "avinfo", "", "", 1, true);
160159

161160
OperationStatus status = operationManager.prefop(bucket, jobID);
162161
assertNotNull(status, "1. prefop type error");
162+
assertNotNull(status.creationDate, "1. prefop type error");
163163
assertTrue(status.code == 0 || status.code == 1 || status.code == 3, "2. prefop type error");
164-
assertEquals("1", status.type, "3. prefop type error");
164+
assertEquals(1, (int) status.type, "3. prefop type error");
165165
}
166166

167167
} catch (QiniuException ex) {

0 commit comments

Comments
 (0)