From d4a35c79eb78419e1044bcaa02d5e02473d00275 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 21 Mar 2022 12:48:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=97=B6=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E5=88=86=E5=BA=94=E7=94=A8=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/service/ProjectService.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/ProjectService.java b/backend/src/main/java/io/metersphere/service/ProjectService.java index 2d0f6dc9a8..0cce33e110 100644 --- a/backend/src/main/java/io/metersphere/service/ProjectService.java +++ b/backend/src/main/java/io/metersphere/service/ProjectService.java @@ -177,17 +177,25 @@ public class ProjectService { projectVersion.setStatus("open"); projectVersionService.addProjectVersion(projectVersion); } + initProjectApplication(project.getId()); + return project; + } + private void initProjectApplication(String projectId) { //创建新项目也创建相关新项目的应用(分测试跟踪,接口,性能) ProjectApplication projectApplication = new ProjectApplication(); - projectApplication.setProjectId(project.getId()); + projectApplication.setProjectId(projectId); //每个新项目都会有测试跟踪/性能报告分享链接的有效时间,默认时间24H projectApplication.setType(ProjectApplicationType.TRACK_SHARE_REPORT_TIME.toString()); projectApplication.setTypeValue("24H"); projectApplicationMapper.insert(projectApplication); projectApplication.setType(ProjectApplicationType.PERFORMANCE_SHARE_REPORT_TIME.toString()); projectApplicationMapper.insert(projectApplication); - return project; + projectApplication.setType(ProjectApplicationType.API_SHARE_REPORT_TIME.toString()); + projectApplicationMapper.insert(projectApplication); + projectApplication.setType(ProjectApplicationType.CASE_CUSTOM_NUM.toString()); + projectApplication.setTypeValue(Boolean.FALSE.toString()); + projectApplicationMapper.insert(projectApplication); } public void checkThirdProjectExist(Project project) {