diff --git a/backend/pom.xml b/backend/pom.xml index a2d5757ea878..624a7cd13a9d 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -88,6 +88,11 @@ spring-boot-starter-websocket + + org.springframework.boot + spring-boot-starter-validation + + org.flywaydb diff --git a/backend/src/main/java/io/metersphere/Application.java b/backend/src/main/java/io/metersphere/Application.java index 3e9715e77547..202977b8ff85 100644 --- a/backend/src/main/java/io/metersphere/Application.java +++ b/backend/src/main/java/io/metersphere/Application.java @@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration; +import org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration; import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.ServletComponentScan; @@ -13,7 +14,8 @@ @SpringBootApplication(exclude = { QuartzAutoConfiguration.class, - LdapAutoConfiguration.class + LdapAutoConfiguration.class, + Neo4jAutoConfiguration.class }) @ServletComponentScan @EnableConfigurationProperties({ diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index a9d02efd14cb..9dcd1646863c 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -109,17 +109,17 @@ public void createSchedule(@RequestBody ScheduleRequest request) { } @PostMapping(value = "/create", consumes = {"multipart/form-data"}) - public void create(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List bodyFiles) { + public void create(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file", required = false) MultipartFile file, @RequestPart(value = "files", required = false) List bodyFiles) { apiTestService.create(request, file, bodyFiles); } @PostMapping(value = "/create/merge", consumes = {"multipart/form-data"}) - public void mergeCreate(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "selectIds") List selectIds) { + public void mergeCreate(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file", required = false) MultipartFile file, @RequestPart(value = "selectIds") List selectIds) { apiTestService.mergeCreate(request, file, selectIds); } @PostMapping(value = "/update", consumes = {"multipart/form-data"}) - public void update(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List bodyFiles) { + public void update(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file", required = false) MultipartFile file, @RequestPart(value = "files", required = false) List bodyFiles) { checkownerService.checkApiTestOwner(request.getId()); apiTestService.update(request, file, bodyFiles); } @@ -148,7 +148,7 @@ public String run(@RequestBody SaveAPITestRequest request) { } @PostMapping(value = "/run/debug", consumes = {"multipart/form-data"}) - public String runDebug(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List bodyFiles) { + public String runDebug(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file", required = false) MultipartFile file, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestService.runDebug(request, file, bodyFiles); } @@ -392,7 +392,7 @@ public String historicalDataUpgrade(@RequestBody SaveHistoricalDataUpgrade reque } @PostMapping(value = "/genPerformanceTestXml", consumes = {"multipart/form-data"}) - public JmxInfoDTO genPerformanceTest(@RequestPart("request") RunDefinitionRequest runRequest, @RequestPart(value = "files") List bodyFiles) throws Exception { + public JmxInfoDTO genPerformanceTest(@RequestPart("request") RunDefinitionRequest runRequest, @RequestPart(value = "files", required = false) List bodyFiles) throws Exception { ParameterConfig config = new ParameterConfig(); config.setProjectId(runRequest.getProjectId()); diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index 763615776be6..268b5a1aa6a0 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -78,16 +78,16 @@ public List list(@PathVariable String projectId) { @PostMapping(value = "/create") @MsAuditLog(module = "api_automation", type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_CREATE) - public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles") List bodyFiles, - @RequestPart(value = "scenarioFiles") List scenarioFiles) { + public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, + @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { return apiAutomationService.create(request, bodyFiles, scenarioFiles); } @PostMapping(value = "/update") @MsAuditLog(module = "api_automation", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT) - public void update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles") List bodyFiles, - @RequestPart(value = "scenarioFiles") List scenarioFiles) { + public void update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, + @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { apiAutomationService.update(request, bodyFiles, scenarioFiles); } @@ -156,7 +156,7 @@ public List getApiScenarios(@RequestBody List ids) @PostMapping(value = "/run/debug") @MsAuditLog(module = "api_automation", type = OperLogConstants.DEBUG, title = "#request.scenarioName", project = "#request.projectId") public void runDebug(@RequestPart("request") RunDefinitionRequest request, - @RequestPart(value = "bodyFiles") List bodyFiles, @RequestPart(value = "scenarioFiles") List scenarioFiles) { + @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { request.setExecuteType(ExecuteType.Debug.name()); apiAutomationService.debugRun(request, bodyFiles, scenarioFiles); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java index 2b0da965de98..4faa3d53dd8a 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java @@ -97,7 +97,7 @@ public List listBatch(@RequestBody ApiBatchRequest request) @PostMapping(value = "/create", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) @MsAuditLog(module = "api_definition", type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiDefinitionService.class) - public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files") List bodyFiles) { + public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); return apiDefinitionService.create(request, bodyFiles); } @@ -105,7 +105,7 @@ public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRe @PostMapping(value = "/update", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) @MsAuditLog(module = "api_definition", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiDefinitionService.class) - public ApiDefinitionWithBLOBs update(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files") List bodyFiles) { + public ApiDefinitionWithBLOBs update(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); return apiDefinitionService.update(request, bodyFiles); } @@ -166,13 +166,13 @@ public ApiDefinition get(@PathVariable String id) { @PostMapping(value = "/run/debug", consumes = {"multipart/form-data"}) @MsAuditLog(module = "api_definition", type = OperLogConstants.DEBUG, title = "#request.name", project = "#request.projectId") - public String runDebug(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files") List bodyFiles) { + public String runDebug(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiDefinitionService.run(request, bodyFiles); } @PostMapping(value = "/run", consumes = {"multipart/form-data"}) @MsAuditLog(module = "api_definition", type = OperLogConstants.EXECUTE, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") - public String run(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files") List bodyFiles) { + public String run(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { request.setReportId(null); return apiDefinitionService.run(request, bodyFiles); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java index 9d1d97fb71cc..e6551dcab300 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java @@ -90,13 +90,13 @@ public List getCaseBLOBs(@RequestBody ApiTestCaseRequest reques @PostMapping(value = "/create", consumes = {"multipart/form-data"}) @MsAuditLog(module = "api_definition", type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) - public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List bodyFiles) { + public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.create(request, bodyFiles); } @PostMapping(value = "/update", consumes = {"multipart/form-data"}) @MsAuditLog(module = "api_definition", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) - public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List bodyFiles) { + public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.update(request, bodyFiles); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java index e7e45a28e056..c1d9a7284c3d 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java @@ -70,13 +70,13 @@ public List getEntry(@RequestPart("request") String password, @Re @PostMapping("/add") @MsAuditLog(module = "project_environment_setting", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#apiTestEnvironmentWithBLOBs.id)", msClass = ApiTestEnvironmentService.class) - public String create(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironmentWithBLOBs, @RequestPart(value = "files") List sslFiles) { + public String create(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironmentWithBLOBs, @RequestPart(value = "files", required = false) List sslFiles) { return apiTestEnvironmentService.add(apiTestEnvironmentWithBLOBs, sslFiles); } @PostMapping(value = "/update") @MsAuditLog(module = "project_environment_setting", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#apiTestEnvironment.id)", content = "#msClass.getLogDetails(#apiTestEnvironment.id)", msClass = ApiTestEnvironmentService.class) - public void update(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironment, @RequestPart(value = "files") List sslFiles) { + public void update(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironment, @RequestPart(value = "files", required = false) List sslFiles) { apiTestEnvironmentService.update(apiTestEnvironment, sslFiles); } diff --git a/backend/src/main/java/io/metersphere/controller/JarConfigController.java b/backend/src/main/java/io/metersphere/controller/JarConfigController.java index d961fb433cd3..a89126f3a2e7 100644 --- a/backend/src/main/java/io/metersphere/controller/JarConfigController.java +++ b/backend/src/main/java/io/metersphere/controller/JarConfigController.java @@ -47,7 +47,7 @@ public JarConfig get(@PathVariable String id) { @PostMapping(value = "/add", consumes = {"multipart/form-data"}) @MsAuditLog(module = "project_project_jar", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = JarConfigService.class) - public String add(@RequestPart("request") JarConfig request, @RequestPart(value = "file") MultipartFile file) { + public String add(@RequestPart("request") JarConfig request, @RequestPart(value = "file", required = false) MultipartFile file) { return JarConfigService.add(request, file); } diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 68cd181e1901..842681776339 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -114,13 +114,13 @@ public void updateProject(@RequestBody Project Project) { @PostMapping(value = "upload/files/{projectId}", consumes = {"multipart/form-data"}) @MsAuditLog(module = "project_file_management", type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class) - public List uploadFiles(@PathVariable String projectId, @RequestPart(value = "file") List files) { + public List uploadFiles(@PathVariable String projectId, @RequestPart(value = "file", required = false) List files) { return projectService.uploadFiles(projectId, files); } @PostMapping(value = "/update/file/{fileId}", consumes = {"multipart/form-data"}) @MsAuditLog(module = "project_file_management", type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class) - public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file") MultipartFile file) { + public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file", required = false) MultipartFile file) { return projectService.updateFile(fileId, file); } diff --git a/backend/src/main/java/io/metersphere/controller/ResourceController.java b/backend/src/main/java/io/metersphere/controller/ResourceController.java index 8aded05efe7d..750c2c4713d0 100644 --- a/backend/src/main/java/io/metersphere/controller/ResourceController.java +++ b/backend/src/main/java/io/metersphere/controller/ResourceController.java @@ -19,7 +19,7 @@ public class ResourceController { @Resource ResourceService resourceService; @PostMapping(value = "/md/upload", consumes = {"multipart/form-data"}) - public void upload(@RequestPart(value = "request") MdUploadRequest request, @RequestPart(value = "file") MultipartFile file) { + public void upload(@RequestPart(value = "request") MdUploadRequest request, @RequestPart(value = "file", required = false) MultipartFile file) { resourceService.mdUpload(request, file); } diff --git a/backend/src/main/java/io/metersphere/controller/TestController.java b/backend/src/main/java/io/metersphere/controller/TestController.java index b5ef02263158..6f2a56500052 100644 --- a/backend/src/main/java/io/metersphere/controller/TestController.java +++ b/backend/src/main/java/io/metersphere/controller/TestController.java @@ -18,8 +18,8 @@ public class TestController { @PostMapping(value = "/upload", consumes = {"multipart/form-data"}) - public Object testUpload(@RequestPart(value = "id") String id, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List bodyFiles - , @RequestPart(value = "user") User user, @RequestParam(value = "name") String name) { + public Object testUpload(@RequestPart(value = "id") String id, @RequestPart(value = "file", required = false) MultipartFile file, @RequestPart(value = "files", required = false) List bodyFiles + , @RequestPart(value = "user") User user, @RequestParam(value = "name") String name) { JSONObject jsonObject = new JSONObject(); jsonObject.put("id", id); jsonObject.put("file", file.getOriginalFilename()); diff --git a/backend/src/main/java/io/metersphere/controller/handler/GlobalExceptionHandler.java b/backend/src/main/java/io/metersphere/controller/handler/GlobalExceptionHandler.java deleted file mode 100644 index 53d730331ee7..000000000000 --- a/backend/src/main/java/io/metersphere/controller/handler/GlobalExceptionHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.metersphere.controller.handler; - -import io.metersphere.controller.ResultHolder; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.LoggerFactory; -import org.springframework.boot.web.servlet.error.ErrorAttributes; -import org.springframework.boot.web.servlet.error.ErrorController; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.ServletWebRequest; -import org.springframework.web.context.request.WebRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Map; -import java.util.Objects; - - -@RestController -public class GlobalExceptionHandler implements ErrorController { - - public static final org.slf4j.Logger Logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); - - private static final String PATH = "/error"; - - @Resource - private ErrorAttributes errorAttributes; - - @Override - public String getErrorPath() { - return PATH; - } - - @RequestMapping(value = {PATH}, produces = {"text/html"}) - public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse response) { - return new ModelAndView("error", this.getErrorAttributes(request, false)); - } - - @RequestMapping(value = PATH) - public ResultHolder error(HttpServletRequest request, HttpServletResponse response) { - WebRequest webRequest = new ServletWebRequest(request); - Throwable t = errorAttributes.getError(webRequest); - Map errorAttributeMap = errorAttributes.getErrorAttributes(webRequest, true); - Integer code = (Integer) errorAttributeMap.get("status"); - response.setStatus(code); - String errorMessage = StringUtils.EMPTY; - if (t != null) { - if (Logger.isDebugEnabled()) { - Logger.error("Fail to proceed " + errorAttributeMap.get("path"), t); - } - errorMessage = t.getMessage(); - } - if (StringUtils.isBlank(errorMessage)) { - if (code == 403) { - errorMessage = "Permission Denied."; - } else if (code == 404) { - String path = request.getServletPath(); - if (Objects.nonNull(request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI)) && StringUtils.isNotBlank(request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI).toString())) { - path = request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI).toString(); - } - errorMessage = path + " not found."; - } else { - errorMessage = "The server responds " + code + " but no detailed message."; - } - } - return ResultHolder.error(errorMessage); - } - - protected Map getErrorAttributes(HttpServletRequest request, boolean includeStackTrace) { - WebRequest webRequest = new ServletWebRequest(request); - return this.errorAttributes.getErrorAttributes(webRequest, includeStackTrace); - } - -} diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java index 617b8ea9f017..be533b4daa8a 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java @@ -79,7 +79,7 @@ public LoadTest listByTestId(@PathVariable String testId) { @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE) public String save( @RequestPart("request") SaveTestPlanRequest request, - @RequestPart(value = "file") List files + @RequestPart(value = "file", required = false) List files ) { request.setId(UUID.randomUUID().toString()); checkPermissionService.checkProjectOwner(request.getProjectId()); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 055dbb0b9c33..7d858ba60e25 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -129,20 +129,20 @@ public Project getProjectByTestCaseId(@PathVariable String testCaseId) { @PostMapping(value = "/add", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_CREATE) @MsAuditLog(module = "track_test_case", type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) - public String addTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List files) { + public String addTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { request.setId(UUID.randomUUID().toString()); return testCaseService.save(request, files); } @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @MsAuditLog(module = "track_test_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) - public String editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List files) { + public String editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { return testCaseService.edit(request, files); } @PostMapping(value = "/edit/testPlan", consumes = {"multipart/form-data"}) @MsAuditLog(module = "track_test_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogBeforeDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) - public String editTestCaseByTestPlan(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List files) { + public String editTestCaseByTestPlan(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { return testCaseService.editTestCase(request, files); } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 87b900d9c555..846026f76e50 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 87b900d9c55591b1a3a6044172ef02c0bf5b145c +Subproject commit 846026f76e50c5a6533a76c0f9822f7b0146b325 diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 960fe3f3a3c0..824a447d28a5 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -24,12 +24,11 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true - logging.file.path=/opt/metersphere/logs/${spring.application.name} - # view -spring.resources.static-locations=classpath:/templates/,classpath:/static/ - +spring.mvc.throw-exception-if-no-handler-found=true +spring.web.resources.add-mappings=false +spring.web.resources.static-locations=classpath:/templates/,classpath:/static/ # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/pom.xml b/pom.xml index cda122e9e45b..2fcc539919f5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.6.RELEASE + 2.5.0