refactor(接口测试): 优化接口对应的mock查询方法
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
55cfbcf214
commit
a2307dd428
|
@ -14,16 +14,14 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByApiIdIn" resultType="io.metersphere.api.dto.mock.config.MockConfigImportDTO">
|
<select id="selectByApiIdIn" resultType="io.metersphere.api.dto.mock.config.MockConfigImportDTO">
|
||||||
SELECT
|
SELECT
|
||||||
mock_expect_config.*,
|
mock_expect_config.*,mock_config.api_id AS apiId
|
||||||
mock_config.api_id AS apiId
|
|
||||||
FROM
|
FROM
|
||||||
mock_expect_config
|
mock_expect_config
|
||||||
LEFT JOIN mock_config ON mock_expect_config.mock_config_id = mock_config.id
|
LEFT JOIN mock_config ON mock_expect_config.mock_config_id = mock_config.id
|
||||||
WHERE mock_config.api_id in (
|
WHERE mock_config.api_id in
|
||||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
#{value}
|
#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectExlectNumByMockConfigId" resultType="java.lang.String">
|
<select id="selectExlectNumByMockConfigId" resultType="java.lang.String">
|
||||||
|
|
|
@ -1438,6 +1438,7 @@ public class ApiDefinitionService {
|
||||||
|
|
||||||
public ApiExportResult export(ApiBatchRequest request, String type) {
|
public ApiExportResult export(ApiBatchRequest request, String type) {
|
||||||
ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiDefinitionMapper.selectIds(query));
|
ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiDefinitionMapper.selectIds(query));
|
||||||
|
LogUtil.info("导出总量 ",request.getIds());
|
||||||
|
|
||||||
List<ApiDefinitionWithBLOBs> apiDefinitions = getByIds(request.getIds());
|
List<ApiDefinitionWithBLOBs> apiDefinitions = getByIds(request.getIds());
|
||||||
|
|
||||||
|
@ -1450,6 +1451,7 @@ public class ApiDefinitionService {
|
||||||
msApiExportResult.setProtocol(request.getProtocol());
|
msApiExportResult.setProtocol(request.getProtocol());
|
||||||
msApiExportResult.setProjectId(request.getProjectId());
|
msApiExportResult.setProjectId(request.getProjectId());
|
||||||
msApiExportResult.setVersion(System.getenv("MS_VERSION"));
|
msApiExportResult.setVersion(System.getenv("MS_VERSION"));
|
||||||
|
LogUtil.info("导出数据组装完成 ",request.getIds());
|
||||||
return msApiExportResult;
|
return msApiExportResult;
|
||||||
} else { // 导出为 Swagger 格式
|
} else { // 导出为 Swagger 格式
|
||||||
Swagger3Parser swagger3Parser = new Swagger3Parser();
|
Swagger3Parser swagger3Parser = new Swagger3Parser();
|
||||||
|
|
Loading…
Reference in New Issue