From 0fa6a1c7117264aadc3d4cf54f0fe0cde8ac59b3 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 27 Dec 2023 18:21:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E6=8F=92=E4=BB=B6=E9=9C=80=E6=B1=82domain=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/dto/reponse/DemandDTO.java | 15 ------- .../dto/reponse/DemandRelatePageResponse.java | 43 +++++++++++++++++++ .../dto/request/DemandPageRequest.java | 7 +++ .../plugin/platform/spi/Platform.java | 16 +++---- 4 files changed, 55 insertions(+), 26 deletions(-) delete mode 100644 backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandDTO.java create mode 100644 backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandRelatePageResponse.java diff --git a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandDTO.java b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandDTO.java deleted file mode 100644 index 7c387d8098..0000000000 --- a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandDTO.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.metersphere.plugin.platform.dto.reponse; - -import lombok.Data; - -@Data -public class DemandDTO { - /** - * ID - */ - protected String id; - /** - * 名称 - */ - protected String name; -} diff --git a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandRelatePageResponse.java b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandRelatePageResponse.java new file mode 100644 index 0000000000..8e18b13e37 --- /dev/null +++ b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/reponse/DemandRelatePageResponse.java @@ -0,0 +1,43 @@ +package io.metersphere.plugin.platform.dto.reponse; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class DemandRelatePageResponse { + + /** + * 自定义表头字段 + */ + private Map customHeaderMap; + /** + * 需求列表数据 + */ + private List demandList; + + @Data + public static class Demand { + /** + * 需求ID + */ + private String demandId; + /** + * 父需求ID + */ + private String parent; + /** + * 需求名称/标题 + */ + private String demandName; + /** + * 需求地址 + */ + private String demandUrl; + /** + * 自定义字段 + */ + private Map customFields; + } +} diff --git a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/request/DemandPageRequest.java b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/request/DemandPageRequest.java index e108c718c1..5d67e6bd2a 100644 --- a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/request/DemandPageRequest.java +++ b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/dto/request/DemandPageRequest.java @@ -2,6 +2,8 @@ package io.metersphere.plugin.platform.dto.request; import lombok.Data; +import java.util.Map; + @Data public class DemandPageRequest { @@ -15,6 +17,11 @@ public class DemandPageRequest { */ private String query; + /** + * 筛选条件 + */ + private Map filter; + /** * 开始页码 */ diff --git a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java index 70aa73e914..8660f7ccdc 100644 --- a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java +++ b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java @@ -2,7 +2,7 @@ package io.metersphere.plugin.platform.spi; import io.metersphere.plugin.platform.dto.SelectOption; import io.metersphere.plugin.platform.dto.SyncBugResult; -import io.metersphere.plugin.platform.dto.reponse.DemandDTO; +import io.metersphere.plugin.platform.dto.reponse.DemandRelatePageResponse; import io.metersphere.plugin.platform.dto.reponse.PlatformBugUpdateDTO; import io.metersphere.plugin.platform.dto.reponse.PlatformCustomFieldItemDTO; import io.metersphere.plugin.platform.dto.request.*; @@ -70,19 +70,11 @@ public interface Platform extends ExtensionPoint { List getStatusTransitions(String projectConfig, String issueKey); /** - * 获取第三方平台需求 + * 获取第三方平台关联需求列表 * @param request 需求分页查询参数 * @return 需求分页数据 */ - PluginPager> pageDemand(DemandPageRequest request); - - /** - * 获取第三方平台已关联的需求集合 - * @param request 查询请求参数 - * @return 需求数据集合 - */ - List getDemands(DemandRelateQueryRequest request); - + PluginPager pageDemand(DemandPageRequest request); /** * 新增平台缺陷 @@ -131,6 +123,8 @@ public interface Platform extends ExtensionPoint { /** * 同步全量缺陷 + * + * @param request 同步缺陷参数 */ void syncAllBugs(SyncAllBugRequest request);