feat(接口自动化): 查看场景引用
This commit is contained in:
parent
c30e933463
commit
eee5bc586a
|
@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
|
@ -81,5 +82,10 @@ public class ApiAutomationController {
|
|||
apiAutomationService.run(request);
|
||||
}
|
||||
|
||||
@PostMapping("/getReference")
|
||||
public List<ApiScenario> getReference(@RequestBody ApiScenarioRequest request) {
|
||||
return apiAutomationService.getReference(request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
@ -299,4 +300,8 @@ public class ApiAutomationService {
|
|||
createAPIReportResult(request.getId());
|
||||
return request.getId();
|
||||
}
|
||||
|
||||
public List<ApiScenario> getReference(ApiScenarioRequest request) {
|
||||
return extApiScenarioMapper.selectReference(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,4 +14,6 @@ public interface ExtApiScenarioMapper {
|
|||
|
||||
List<ApiScenario> selectIds(@Param("ids") List<String> ids);
|
||||
|
||||
List<ApiScenario> selectReference(@Param("request") ApiScenarioRequest request);
|
||||
|
||||
}
|
||||
|
|
|
@ -70,4 +70,23 @@
|
|||
#{v}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectReference" resultType="io.metersphere.base.domain.ApiScenario">
|
||||
select * from api_scenario
|
||||
<where>
|
||||
id != #{request.id}
|
||||
<if test="request.workspaceId != null">
|
||||
AND project.workspace_id = #{request.workspaceId}
|
||||
</if>
|
||||
<if test="request.projectId != null">
|
||||
AND project_id = #{request.projectId}
|
||||
</if>
|
||||
<if test="request.moduleId != null">
|
||||
AND api_scenario_module_id = #{request.moduleId}
|
||||
</if>
|
||||
and scenario_definition like CONCAT('%', #{request.id},'%')
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue