mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-09 18:32:16 +08:00
由于magicProperties属于上层依赖,只能在SqlModule增加Environment属性支持获取配置属性
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.ssssssss.magicapi.modules;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.dao.DataRetrievalFailureException;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.jdbc.core.ArgumentPreparedStatementSetter;
|
||||
@@ -59,6 +60,8 @@ public class SQLModule extends HashMap<String, SQLModule> implements MagicModule
|
||||
|
||||
private String cacheName;
|
||||
|
||||
private Environment environment;
|
||||
|
||||
private List<SQLInterceptor> sqlInterceptors;
|
||||
|
||||
private long ttl;
|
||||
@@ -131,6 +134,14 @@ public class SQLModule extends HashMap<String, SQLModule> implements MagicModule
|
||||
this.ttl = ttl;
|
||||
}
|
||||
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
public Environment getEnvironment() {
|
||||
return environment;
|
||||
}
|
||||
|
||||
protected SqlCache getSqlCache() {
|
||||
return sqlCache;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user