refactor(缺陷管理): 删除缺陷接口参数优化

This commit is contained in:
song-cc-rock 2024-07-19 16:00:06 +08:00 committed by Craftsman
parent f68f2529fe
commit 03a5af4f73
3 changed files with 23 additions and 3 deletions

View File

@ -0,0 +1,17 @@
package io.metersphere.plugin.platform.dto.request;
import lombok.Data;
@Data
public class PlatformBugDeleteRequest {
/**
* 项目配置信息 (兼容部分平台)
*/
private String projectConfig;
/**
* 平台缺陷Key
*/
private String platformBugKey;
}

View File

@ -111,9 +111,9 @@ public interface Platform extends ExtensionPoint {
/** /**
* 删除平台缺陷 * 删除平台缺陷
* *
* @param platformBugId 平台缺陷ID * @param request 平台缺陷删除参数
*/ */
void deleteBug(String platformBugId); void deleteBug(PlatformBugDeleteRequest request);
/** /**
* 平台是否支持附件API * 平台是否支持附件API

View File

@ -329,7 +329,10 @@ public class BugService {
if (StringUtils.equals(platformName, bug.getPlatform())) { if (StringUtils.equals(platformName, bug.getPlatform())) {
// 需同步删除平台缺陷 // 需同步删除平台缺陷
Platform platform = projectApplicationService.getPlatform(bug.getProjectId(), true); Platform platform = projectApplicationService.getPlatform(bug.getProjectId(), true);
platform.deleteBug(bug.getPlatformBugId()); PlatformBugDeleteRequest deleteRequest = new PlatformBugDeleteRequest();
deleteRequest.setPlatformBugKey(bug.getPlatformBugId());
deleteRequest.setProjectConfig(projectApplicationService.getProjectBugThirdPartConfig(bug.getProjectId()));
platform.deleteBug(deleteRequest);
} }
// 删除缺陷后, 前置操作: 删除关联用例, 删除关联附件 // 删除缺陷后, 前置操作: 删除关联用例, 删除关联附件
bugCommonService.clearAssociateResource(bug.getProjectId(), List.of(id)); bugCommonService.clearAssociateResource(bug.getProjectId(), List.of(id));