From 540124bbbc2ebaa30a669edcc0690d88b7ebe9f1 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Tue, 25 Oct 2022 14:26:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=A6=85=E9=81=93GET=E6=96=B9=E5=BC=8F=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018812 --user=宋昌昌 【测试跟踪】Zentao平台创建缺陷,上传附件未同步上传到缺陷平台里 https://www.tapd.cn/55049933/s/1276291 --- .../java/io/metersphere/service/issue/client/ZentaoClient.java | 2 +- .../io/metersphere/service/issue/client/ZentaoGetClient.java | 2 +- .../metersphere/service/issue/client/ZentaoPathInfoClient.java | 2 +- .../io/metersphere/service/issue/platform/ZentaoPlatform.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoClient.java b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoClient.java index d5a784055e..230d7cd4e7 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoClient.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoClient.java @@ -223,7 +223,7 @@ public abstract class ZentaoClient extends BaseClient { try { restTemplate.exchange(requestUrl.getFileUpload(), HttpMethod.POST, requestEntity, - String.class, objectType, objectId, sessionId); + String.class, objectId, sessionId); } catch (Exception e) { LogUtil.info("upload zentao attachment error"); } diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoGetClient.java b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoGetClient.java index e05e2b7482..e3d816200c 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoGetClient.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoGetClient.java @@ -16,7 +16,7 @@ public class ZentaoGetClient extends ZentaoClient { private static final String STORY_GET="&module=story&methodName=getProductStories¶ms=productID={key}&t=json&zentaosid="; private static final String USER_GET="&module=user&methodName=getList&t=json&zentaosid="; private static final String BUILDS_GET="&module=build&methodName=getProductBuildPairs&productID={0}&zentaosid={1}"; - private static final String FILE_UPLOAD="&module=file&methodName=saveUpload¶ms=objectType=bug&zentaosid={1}"; + private static final String FILE_UPLOAD="&module=file&methodName=saveUpload¶ms=objectType=bug,objectID={1}&zentaosid={2}"; private static final String FILE_DELETE="/?m=file&f=delete&t=json&fileID={1}&confirm=yes&zentaosid={2}"; private static final String FILE_DOWNLOAD="/?m=file&f=download&t=json&fileID={1}&mouse=click&zentaosid={2}"; private static final String CREATE_META_DATA="?m=bug&f=create&productID={0}&t=json&zentaosid={1}"; diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoPathInfoClient.java b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoPathInfoClient.java index b34c54e879..c19f120c04 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoPathInfoClient.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/client/ZentaoPathInfoClient.java @@ -16,7 +16,7 @@ public class ZentaoPathInfoClient extends ZentaoClient { private static final String USER_GET = "/api-getModel-user-getList?zentaosid="; private static final String BUILDS_GET = "/api-getModel-build-getProductBuildPairs-productID={0}?zentaosid={1}"; private static final String CREATE_META_DATA="/bug-create-{0}.json?zentaosid={1}"; - private static final String FILE_UPLOAD = "/api-getModel-file-saveUpload-objectType=bug?zentaosid={1}"; + private static final String FILE_UPLOAD = "/api-getModel-file-saveUpload-objectType=bug,objectID={1}?zentaosid={2}"; private static final String FILE_DELETE = "/file-delete-{1}-.yes.json?zentaosid={2}"; private static final String FILE_DOWNLOAD="/file-download-{1}-.click.json?zentaosid={2}"; private static final String REPLACE_IMG_URL = ""; diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java index f153ab516f..758d644fac 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java @@ -445,7 +445,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform { try { String fileUpload = zentaoClient.requestUrl.getFileUpload(); ResponseEntity responseEntity = restTemplate.exchange(fileUpload, HttpMethod.POST, requestEntity, - String.class, session); + String.class, null, session); String body = responseEntity.getBody(); Map obj = JSON.parseMap(body); Map data = (Map) JSON.parseObject(obj.get("data").toString());