refactor: UI报告处理代码优化

This commit is contained in:
chenjianxing 2022-04-14 14:48:47 +08:00 committed by jianxing
parent 8825abf2dc
commit 09f4d7057e
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ public class ApiScenarioReportService {
@Resource @Resource
private ApiDefinitionExecResultMapper definitionExecResultMapper; private ApiDefinitionExecResultMapper definitionExecResultMapper;
@Resource @Resource
private UiAutomationProxyService uiAutomationProxyService; private UiReporServicetProxy uiReporServicetProxy;
public void saveResult(List<RequestResult> requestResults, ResultDTO dto) { public void saveResult(List<RequestResult> requestResults, ResultDTO dto) {
// 报告详情内容 // 报告详情内容
@ -94,7 +94,7 @@ public class ApiScenarioReportService {
public void saveUiResult(List<RequestResult> requestResults, ResultDTO dto) { public void saveUiResult(List<RequestResult> requestResults, ResultDTO dto) {
// 报告详情内容 // 报告详情内容
uiAutomationProxyService.saveUiResult(dto.getReportId(), requestResults); uiReporServicetProxy.saveUiResult(dto.getReportId(), requestResults);
} }
public ApiScenarioReport testEnded(ResultDTO dto) { public ApiScenarioReport testEnded(ResultDTO dto) {

View File

@ -12,7 +12,7 @@ import java.util.function.Function;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class UiAutomationProxyService { public class UiReporServicetProxy {
public Object saveUiResult(String reportId, List<RequestResult> queue) { public Object saveUiResult(String reportId, List<RequestResult> queue) {
return invoke((clazz) -> { return invoke((clazz) -> {
@ -26,7 +26,7 @@ public class UiAutomationProxyService {
} }
private Object invoke(Function<Class, Method> getDeclaredMethod, Object... args) { private Object invoke(Function<Class, Method> getDeclaredMethod, Object... args) {
Object uiAutomationService = CommonBeanFactory.getBean("uiAutomationService"); Object uiAutomationService = CommonBeanFactory.getBean("uiReportService");
try { try {
Class<?> clazz = uiAutomationService.getClass(); Class<?> clazz = uiAutomationService.getClass();
Method postProcessUiReport = getDeclaredMethod.apply(clazz); Method postProcessUiReport = getDeclaredMethod.apply(clazz);