mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
solon
This commit is contained in:
parent
15fefbd458
commit
a286bf811d
@ -49,7 +49,7 @@ public class XPluginImpl implements Plugin {
|
||||
}
|
||||
});
|
||||
// 读取配置
|
||||
Prop prop = new Prop(context.cfg().getProp("mybatis-plus-join"));
|
||||
Prop prop = new Prop(context.cfg());
|
||||
ConfigProperties.banner = prop.get("banner", Boolean::parseBoolean);
|
||||
ConfigProperties.subTableLogic = prop.get("subTableLogic", Boolean::parseBoolean);
|
||||
ConfigProperties.msCache = prop.get("msCache", Boolean::parseBoolean);
|
||||
@ -76,10 +76,12 @@ public class XPluginImpl implements Plugin {
|
||||
|
||||
private final Properties props;
|
||||
|
||||
@SuppressWarnings("SpellCheckingInspection")
|
||||
public Prop(Props props) {
|
||||
this.props = new Properties();
|
||||
props.forEach((k, v) -> this.props.put(k.toString()
|
||||
.replaceAll("[-_]", "").toUpperCase(Locale.ENGLISH), v));
|
||||
this.props = props.entrySet().stream().filter(e -> format(e.getKey().toString())
|
||||
.startsWith("MYBATISPLUSJOIN.")).collect(Collectors.toMap(e -> e.getKey().toString()
|
||||
.substring(e.getKey().toString().lastIndexOf(".") + 1)
|
||||
.toUpperCase(Locale.ENGLISH), Map.Entry::getValue, (o, n) -> n, Properties::new));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -92,5 +94,9 @@ public class XPluginImpl implements Plugin {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String format(String key) {
|
||||
return key.replaceAll("[-_]", "").toUpperCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user