Browse Source
* commit 'e347ac9a96359aaa17e79ad3f95c4fc268368054': REPORT-72851 去除无用导入 REPORT-72851 TitlePlaceProcessor 11.0.2之后版本不生效了 REPORT-73800【设计器环境监测】windows下没有finedb权限,设计器报错脏数据 把脏数据的逻辑修改后,导致即便只是锁住、没权限也会出现这个问题。 所以,这里添加一个检测链,前一个检测后,后一个才能继续检测。 并在对具体的类型检测时,保持原来的逻辑 REPORT-73775【设计器环境监测】日志报错finedb占用,错误弹窗显示脏数据 国际化 KEY 值写错了, 改一下。 REPORT-70647 远程设计器场景下主题内边框配置无法使用 REPORT-73670 新建表单背景没有应用主题new-design
superman
2 years ago
9 changed files with 141 additions and 22 deletions
@ -0,0 +1,46 @@ |
|||||||
|
package com.fr.env.detect.impl; |
||||||
|
|
||||||
|
import com.fr.env.detect.base.ExceptionDetector; |
||||||
|
import com.fr.env.detect.bean.DetectorResult; |
||||||
|
import com.fr.env.detect.bean.DetectorStatus; |
||||||
|
import org.jetbrains.annotations.Nullable; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Arrays; |
||||||
|
import java.util.List; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* 检测链 |
||||||
|
* 责任链模式, 有先后顺序,哪一个先获得,哪一个先终止。 |
||||||
|
* |
||||||
|
* created by Harrison on 2022/06/16 |
||||||
|
**/ |
||||||
|
public class DetectorChain { |
||||||
|
|
||||||
|
private List<ExceptionDetector> detectors = new ArrayList<>(); |
||||||
|
|
||||||
|
public static DetectorChain construct(ExceptionDetector... detectors) { |
||||||
|
|
||||||
|
DetectorChain detectorChain = new DetectorChain(); |
||||||
|
detectorChain.detectors = Arrays.stream(detectors).collect(Collectors.toList()); |
||||||
|
return detectorChain; |
||||||
|
} |
||||||
|
|
||||||
|
@Nullable |
||||||
|
public DetectorResult detect() { |
||||||
|
|
||||||
|
for (ExceptionDetector detector : detectors) { |
||||||
|
DetectorResult result = detector.detect(); |
||||||
|
if (result != null && result.getStatus() == DetectorStatus.EXCEPTION) { |
||||||
|
return result; |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public List<ExceptionDetector> getDetectors() { |
||||||
|
|
||||||
|
return this.detectors; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue