feat: V1.1 - lombok集成
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.codechecker.cache.config;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -8,6 +10,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 检测器运行配置。由 {@link ConfigLoader} 加载 jar 内默认配置并与业务配置深度合并后构建。
|
||||
*/
|
||||
@Data
|
||||
public class CheckerConfig {
|
||||
|
||||
/** 总开关:false 时跳过检测与通知(流水线 exit 0) */
|
||||
@@ -36,89 +39,32 @@ public class CheckerConfig {
|
||||
|
||||
private List<String> excludeModules = new ArrayList<>();
|
||||
|
||||
public boolean isBlockMode() {
|
||||
return "block".equalsIgnoreCase(mode);
|
||||
}
|
||||
|
||||
/** 企微通知相关配置。 */
|
||||
@Data
|
||||
public static class Notify {
|
||||
private boolean enabled = true;
|
||||
/** 企微机器人 Webhook 完整 URL */
|
||||
private String webhookUrl = "";
|
||||
private boolean notifyOnClean = false;
|
||||
private String titlePrefix = "[序列化结构变更]";
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getWebhookUrl() {
|
||||
return webhookUrl;
|
||||
}
|
||||
|
||||
public void setWebhookUrl(String webhookUrl) {
|
||||
this.webhookUrl = webhookUrl;
|
||||
}
|
||||
|
||||
public boolean isNotifyOnClean() {
|
||||
return notifyOnClean;
|
||||
}
|
||||
|
||||
public void setNotifyOnClean(boolean notifyOnClean) {
|
||||
this.notifyOnClean = notifyOnClean;
|
||||
}
|
||||
|
||||
public String getTitlePrefix() {
|
||||
return titlePrefix;
|
||||
}
|
||||
|
||||
public void setTitlePrefix(String titlePrefix) {
|
||||
this.titlePrefix = titlePrefix;
|
||||
}
|
||||
}
|
||||
|
||||
/** 忽略规则:key / 文件路径 / 写入方法 / MQ destination。 */
|
||||
@Data
|
||||
public static class Ignore {
|
||||
private List<String> keyPatterns = new ArrayList<>();
|
||||
private List<String> filePatterns = new ArrayList<>();
|
||||
private List<String> writerMethods = new ArrayList<>();
|
||||
/** 忽略的 MQ destination 模式(topic / topic:tag) */
|
||||
private List<String> mqDestinations = new ArrayList<>();
|
||||
|
||||
public List<String> getKeyPatterns() {
|
||||
return keyPatterns;
|
||||
}
|
||||
|
||||
public void setKeyPatterns(List<String> keyPatterns) {
|
||||
this.keyPatterns = keyPatterns;
|
||||
}
|
||||
|
||||
public List<String> getFilePatterns() {
|
||||
return filePatterns;
|
||||
}
|
||||
|
||||
public void setFilePatterns(List<String> filePatterns) {
|
||||
this.filePatterns = filePatterns;
|
||||
}
|
||||
|
||||
public List<String> getWriterMethods() {
|
||||
return writerMethods;
|
||||
}
|
||||
|
||||
public void setWriterMethods(List<String> writerMethods) {
|
||||
this.writerMethods = writerMethods;
|
||||
}
|
||||
|
||||
public List<String> getMqDestinations() {
|
||||
return mqDestinations;
|
||||
}
|
||||
|
||||
public void setMqDestinations(List<String> mqDestinations) {
|
||||
this.mqDestinations = mqDestinations;
|
||||
}
|
||||
}
|
||||
|
||||
/** 检测模式与推断参数(Redis W*、MQ MQ*、读侧补强开关等)。 */
|
||||
@Data
|
||||
public static class Detection {
|
||||
private List<String> patterns = new ArrayList<>();
|
||||
/** MQ 投递检测模式:MQ01~MQ05、MQ-K01~MQ-K04 */
|
||||
@@ -129,255 +75,29 @@ public class CheckerConfig {
|
||||
private boolean readHintsEnabled = true;
|
||||
/** MQ-R:读侧 Listener / parse 补强 */
|
||||
private boolean mqReadHintsEnabled = true;
|
||||
|
||||
public List<String> getPatterns() {
|
||||
return patterns;
|
||||
}
|
||||
|
||||
public void setPatterns(List<String> patterns) {
|
||||
this.patterns = patterns;
|
||||
}
|
||||
|
||||
public List<String> getMqPatterns() {
|
||||
return mqPatterns;
|
||||
}
|
||||
|
||||
public void setMqPatterns(List<String> mqPatterns) {
|
||||
this.mqPatterns = mqPatterns;
|
||||
}
|
||||
|
||||
public double getMinConfidence() {
|
||||
return minConfidence;
|
||||
}
|
||||
|
||||
public void setMinConfidence(double minConfidence) {
|
||||
this.minConfidence = minConfidence;
|
||||
}
|
||||
|
||||
public int getMaxFieldDepth() {
|
||||
return maxFieldDepth;
|
||||
}
|
||||
|
||||
public void setMaxFieldDepth(int maxFieldDepth) {
|
||||
this.maxFieldDepth = maxFieldDepth;
|
||||
}
|
||||
|
||||
public boolean isReadHintsEnabled() {
|
||||
return readHintsEnabled;
|
||||
}
|
||||
|
||||
public void setReadHintsEnabled(boolean readHintsEnabled) {
|
||||
this.readHintsEnabled = readHintsEnabled;
|
||||
}
|
||||
|
||||
public boolean isMqReadHintsEnabled() {
|
||||
return mqReadHintsEnabled;
|
||||
}
|
||||
|
||||
public void setMqReadHintsEnabled(boolean mqReadHintsEnabled) {
|
||||
this.mqReadHintsEnabled = mqReadHintsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工补充映射:在自动推断不准时指定写入方法对应的 key 模式与 value 类型。
|
||||
*/
|
||||
@Data
|
||||
public static class ManualMapping {
|
||||
private String id;
|
||||
private String writerMethod;
|
||||
private String keyPattern;
|
||||
private String valueType;
|
||||
private String description;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWriterMethod() {
|
||||
return writerMethod;
|
||||
}
|
||||
|
||||
public void setWriterMethod(String writerMethod) {
|
||||
this.writerMethod = writerMethod;
|
||||
}
|
||||
|
||||
public String getKeyPattern() {
|
||||
return keyPattern;
|
||||
}
|
||||
|
||||
public void setKeyPattern(String keyPattern) {
|
||||
this.keyPattern = keyPattern;
|
||||
}
|
||||
|
||||
public String getValueType() {
|
||||
return valueType;
|
||||
}
|
||||
|
||||
public void setValueType(String valueType) {
|
||||
this.valueType = valueType;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 抑制规则:对已知误报按 key 模式和/或变更类型跳过告警。
|
||||
*/
|
||||
@Data
|
||||
public static class Suppression {
|
||||
private String id;
|
||||
private String writerMethod;
|
||||
private String keyPattern;
|
||||
private List<String> changeTypes = new ArrayList<>();
|
||||
private String reason;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWriterMethod() {
|
||||
return writerMethod;
|
||||
}
|
||||
|
||||
public void setWriterMethod(String writerMethod) {
|
||||
this.writerMethod = writerMethod;
|
||||
}
|
||||
|
||||
public String getKeyPattern() {
|
||||
return keyPattern;
|
||||
}
|
||||
|
||||
public void setKeyPattern(String keyPattern) {
|
||||
this.keyPattern = keyPattern;
|
||||
}
|
||||
|
||||
public List<String> getChangeTypes() {
|
||||
return changeTypes;
|
||||
}
|
||||
|
||||
public void setChangeTypes(List<String> changeTypes) {
|
||||
this.changeTypes = changeTypes;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public boolean isScanTestSources() {
|
||||
return scanTestSources;
|
||||
}
|
||||
|
||||
public void setScanTestSources(boolean scanTestSources) {
|
||||
this.scanTestSources = scanTestSources;
|
||||
}
|
||||
|
||||
public List<String> getSourceRoots() {
|
||||
return sourceRoots;
|
||||
}
|
||||
|
||||
public void setSourceRoots(List<String> sourceRoots) {
|
||||
this.sourceRoots = sourceRoots;
|
||||
}
|
||||
|
||||
public Notify getNotify() {
|
||||
return notify;
|
||||
}
|
||||
|
||||
public void setNotify(Notify notify) {
|
||||
this.notify = notify;
|
||||
}
|
||||
|
||||
public Ignore getIgnore() {
|
||||
return ignore;
|
||||
}
|
||||
|
||||
public void setIgnore(Ignore ignore) {
|
||||
this.ignore = ignore;
|
||||
}
|
||||
|
||||
public Detection getDetection() {
|
||||
return detection;
|
||||
}
|
||||
|
||||
public void setDetection(Detection detection) {
|
||||
this.detection = detection;
|
||||
}
|
||||
|
||||
public Map<String, String> getSeverityOverrides() {
|
||||
return severityOverrides;
|
||||
}
|
||||
|
||||
public void setSeverityOverrides(Map<String, String> severityOverrides) {
|
||||
this.severityOverrides = severityOverrides;
|
||||
}
|
||||
|
||||
public List<ManualMapping> getManualMappings() {
|
||||
return manualMappings;
|
||||
}
|
||||
|
||||
public void setManualMappings(List<ManualMapping> manualMappings) {
|
||||
this.manualMappings = manualMappings;
|
||||
}
|
||||
|
||||
public List<Suppression> getSuppressions() {
|
||||
return suppressions;
|
||||
}
|
||||
|
||||
public void setSuppressions(List<Suppression> suppressions) {
|
||||
this.suppressions = suppressions;
|
||||
}
|
||||
|
||||
public List<String> getIncludeModules() {
|
||||
return includeModules;
|
||||
}
|
||||
|
||||
public void setIncludeModules(List<String> includeModules) {
|
||||
this.includeModules = includeModules;
|
||||
}
|
||||
|
||||
public List<String> getExcludeModules() {
|
||||
return excludeModules;
|
||||
}
|
||||
|
||||
public void setExcludeModules(List<String> excludeModules) {
|
||||
this.excludeModules = excludeModules;
|
||||
}
|
||||
|
||||
public boolean isBlockMode() {
|
||||
return "block".equalsIgnoreCase(mode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user