mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
refactor(性能测试): 性能测试查询项目下所有的用例(带版本)
This commit is contained in:
parent
9c0761736b
commit
32a82ac55d
@ -0,0 +1,12 @@
|
||||
package io.metersphere.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BaseCase {
|
||||
private String id;
|
||||
private String name;
|
||||
private String projectId;
|
||||
private String versionName;
|
||||
private String type;
|
||||
}
|
@ -2,6 +2,7 @@ package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.base.domain.FileMetadata;
|
||||
import io.metersphere.base.domain.LoadTest;
|
||||
import io.metersphere.dto.BaseCase;
|
||||
import io.metersphere.dto.LoadCaseCountChartResult;
|
||||
import io.metersphere.dto.LoadTestDTO;
|
||||
import io.metersphere.plan.request.LoadCaseRequest;
|
||||
@ -49,4 +50,6 @@ public interface ExtLoadTestMapper {
|
||||
List<LoadCaseCountChartResult> countByRequest(LoadCaseCountRequest request);
|
||||
|
||||
List<LoadTestDTO> relevanceLoadList(@Param("request") LoadCaseRequest request);
|
||||
|
||||
List<BaseCase> selectBaseCaseByProjectId(@Param("projectId") String projectId);
|
||||
}
|
||||
|
@ -630,4 +630,15 @@
|
||||
</include>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseCaseByProjectId" resultType="io.metersphere.dto.BaseCase">
|
||||
select load_test.id, load_test.name, load_test.project_id,'性能测试' as type, project_version.name as version_name
|
||||
from load_test inner join project_version on project_version.project_id = load_test.project_id and
|
||||
project_version.id = load_test.version_id
|
||||
<where>
|
||||
<if test="projectId!=null">
|
||||
and load_test.project_id= #{projectId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -324,4 +324,10 @@ public class PerformanceTestController {
|
||||
public List<LoadTest> getLoadCaseByIds(@RequestBody List<String> ids) {
|
||||
return performanceTestService.getLoadCaseByIds(ids);
|
||||
}
|
||||
|
||||
@GetMapping("/get-base-case/{projectId}")
|
||||
@RequiresPermissions("PROJECT_PERFORMANCE_TEST:READ")
|
||||
public List<BaseCase> getBaseCaseByProjectId(@PathVariable String projectId) {
|
||||
return performanceTestService.getBaseCaseByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
|
@ -1014,4 +1014,8 @@ public class PerformanceTestService {
|
||||
MSException.throwException(errorMessage + Translator.get("project_file_in_use"));
|
||||
}
|
||||
}
|
||||
|
||||
public List<BaseCase> getBaseCaseByProjectId(String projectId) {
|
||||
return extLoadTestMapper.selectBaseCaseByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user