parent
1eeae64d4d
commit
69d0ad32bb
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.i100c.charge.gw.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter",
|
||||
"type": "com.i100c.charge.gw.filter.ZuulPreFilter"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.i100c.charge.gw.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.no-access-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.i100c.charge.gw.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.should-not-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.gwopenapi.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter",
|
||||
"type": "com.charge.gwopenapi.filter.ZuulPreFilter"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.gwopenapi.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.no-access-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.gwopenapi.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.should-not-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.gwmgr.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter",
|
||||
"type": "com.charge.gwmgr.filter.ZuulPreFilter"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.gwmgr.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.no-access-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.gwmgr.filter.ZuulPreFilter",
|
||||
"name": "jwt.filter.should-not-filter",
|
||||
"type": "java.util.List<java.lang.String>"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.kstar.model.ProtocolConfig",
|
||||
"name": "protocol_servers",
|
||||
"type": "com.charge.kstar.model.ProtocolConfig"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.kstar.model.ProtocolConfig",
|
||||
"name": "protocol_servers.list",
|
||||
"type": "java.util.List<com.charge.protocol.common.netty.config.TcpConfig>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.kstar.model.ProtocolConfig",
|
||||
"name": "protocol_servers.name",
|
||||
"type": "java.lang.String"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers",
|
||||
"type": "com.charge.protocol.model.ProtocolConfig"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.list",
|
||||
"type": "java.util.List<com.charge.protocol.common.netty.config.TcpConfig>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.name",
|
||||
"type": "java.lang.String"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers",
|
||||
"type": "com.charge.protocol.model.ProtocolConfig"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.list",
|
||||
"type": "java.util.List<com.charge.protocol.common.netty.config.TcpConfig>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.name",
|
||||
"type": "java.lang.String"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"hints": [],
|
||||
"groups": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers",
|
||||
"type": "com.charge.protocol.model.ProtocolConfig"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.list",
|
||||
"type": "java.util.List<com.charge.protocol.common.netty.config.TcpConfig>"
|
||||
},
|
||||
{
|
||||
"sourceType": "com.charge.protocol.model.ProtocolConfig",
|
||||
"name": "protocol_servers.name",
|
||||
"type": "java.lang.String"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.charge;
|
||||
|
||||
import com.alibaba.druid.wall.WallFilter;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
||||
import com.jfinal.plugin.druid.DruidPlugin;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Configuration
|
||||
public class ActiveRecordPluginConfig {
|
||||
//通过SpringBoot获取到数据库配置
|
||||
@Value("${spring.datasource.username}")
|
||||
private String username;
|
||||
|
||||
@Value("${spring.datasource.password}")
|
||||
private String password;
|
||||
|
||||
@Value("${spring.datasource.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${spring.datasource.driver-class-name}")
|
||||
private String driverClassName;
|
||||
|
||||
@Bean
|
||||
public ActiveRecordPlugin initActiveRecordPlugin() {
|
||||
DruidPlugin druidPlugin = new DruidPlugin(url, username, password, driverClassName);
|
||||
|
||||
// 加强数据库安全
|
||||
WallFilter wallFilter = new WallFilter();
|
||||
wallFilter.setDbType("mysql");
|
||||
druidPlugin.addFilter(wallFilter);
|
||||
druidPlugin.start();
|
||||
|
||||
// 配置ActiveRecord插件
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
|
||||
arp.setDialect(new MysqlDialect());
|
||||
//遍历sql目录下所有的sql文件
|
||||
File sqlDir;
|
||||
String basePath = ActiveRecordPluginConfig.class.getClassLoader().getResource(".").getPath();
|
||||
sqlDir = new File(basePath + "/Sql");
|
||||
File[] sqlFiles = sqlDir.listFiles();
|
||||
for (File sqlFile : sqlFiles != null ? sqlFiles : new File[0]) {
|
||||
//只加载.sql文件
|
||||
if (sqlFile.getName().indexOf(".sql") > 0) {
|
||||
arp.addSqlTemplate("/Sql/" + sqlFile.getName());
|
||||
}
|
||||
}
|
||||
//加载
|
||||
arp.start();
|
||||
return arp;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue