代码生成器支持多数据源表生成
This commit is contained in:
@@ -42,25 +42,6 @@ jdbc:
|
||||
removeAbandoned: true
|
||||
removeAbandonedTimeout: 1800
|
||||
|
||||
# # 多数据源名称列表,启用方式:@MyBatisDao(dataSourceName="ds2")
|
||||
# dataSourceNames: ds2
|
||||
#
|
||||
# # 多数据源配置:ds2
|
||||
# ds2:
|
||||
# type: oracle
|
||||
# driver: oracle.jdbc.driver.OracleDriver
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
# testSql: SELECT 1 FROM DUAL
|
||||
# encrypt:
|
||||
# username: false
|
||||
# password: true
|
||||
# pool:
|
||||
# init: 1
|
||||
# minIdle: 3
|
||||
# maxActive: 20
|
||||
|
||||
# JTA 分布式事务(v4.0.4+)
|
||||
jta:
|
||||
enabled: false
|
||||
@@ -78,21 +59,6 @@ jdbc:
|
||||
#======================================#
|
||||
|
||||
spring:
|
||||
|
||||
# Redis 连接参数 (RedisProperties)
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
ssl: false
|
||||
database: 0
|
||||
password: 1234
|
||||
timeout: 2000
|
||||
lettuce:
|
||||
pool:
|
||||
# 最大空闲连接数
|
||||
maxIdle: 3
|
||||
# 最大活动连接数
|
||||
maxActive: 20
|
||||
|
||||
# 缓存配置
|
||||
cache:
|
||||
@@ -311,10 +277,6 @@ shiro:
|
||||
isGenerateNewSessionAfterLogin: false
|
||||
|
||||
# URI 权限过滤器定义
|
||||
filterChainDefinitions: |
|
||||
/ReportServer/** = user
|
||||
${adminPath}/** = user
|
||||
|
||||
# filterChainDefinitions: |
|
||||
# /ReportServer/** = user
|
||||
# ${adminPath}/file/** = anon
|
||||
@@ -326,12 +288,18 @@ shiro:
|
||||
# ${adminPath}/cms/article/* = anon
|
||||
# ${adminPath}/cms/link/* = anon
|
||||
# ${adminPath}/** = user
|
||||
filterChainDefinitions: |
|
||||
/ReportServer/** = user
|
||||
${adminPath}/** = user
|
||||
|
||||
# 默认的授权过滤定义,如果在filterChainDefinitions中已经定义,则该定义会被覆盖。
|
||||
defaultFilterChainDefinitions: |
|
||||
/static/** = anon
|
||||
/userfiles/** = anon
|
||||
/druid/** = perms[sys:state:druid]
|
||||
/v2/api-docs = perms[sys:swagger]
|
||||
/swagger-ui.html = perms[sys:swagger]
|
||||
/swagger-resources/** = perms[sys:swagger]
|
||||
${adminPath}/login-cas = cas
|
||||
${adminPath}/login = authc
|
||||
${adminPath}/logout = logout
|
||||
@@ -497,7 +465,7 @@ msg:
|
||||
# 短信网关
|
||||
sms:
|
||||
beanName: smsSendService
|
||||
url: http://lehuo520.cn/a/sms/api
|
||||
url: http://localhost:80/msg/sms/send
|
||||
data: username=jeesite&password=jeesite.com
|
||||
prefix: 【JeeSite】
|
||||
suffix: ~
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
-- 代码生成添加数据源字段
|
||||
ALTER TABLE ${_prefix}gen_table ADD data_source_name varchar(64) NULL;
|
||||
|
||||
-- 新增在线文档Swagger菜单
|
||||
INSERT INTO ${_prefix}sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1044942498470014976', '0', '0,', '9040', '0000009040,', '1', 0, '在线文档', '在线文档', '1', '//swagger-ui.html', '', 'icon-book-open', '', 'sys:swagger', 80, '0', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
-- 代码生成添加数据源字段
|
||||
ALTER TABLE ${_prefix}gen_table
|
||||
ADD COLUMN `data_source_name` varchar(64) NULL COMMENT '数据源名称' AFTER `tpl_category`;
|
||||
|
||||
-- 新增在线文档Swagger菜单
|
||||
INSERT INTO ${_prefix}sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1044942498470014976', '0', '0,', '9040', '0000009040,', '1', 0, '在线文档', '在线文档', '1', '//swagger-ui.html', '', 'icon-book-open', '', 'sys:swagger', 80, '0', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
|
||||
commit;
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
-- 代码生成添加数据源字段
|
||||
ALTER TABLE ${_prefix}gen_table ADD data_source_name varchar(64) NULL;
|
||||
COMMENT ON COLUMN ${_prefix}gen_table.data_source_name IS '数据源名称';
|
||||
|
||||
-- 新增在线文档Swagger菜单
|
||||
INSERT INTO ${_prefix}sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1044942498470014976', '0', '0,', '9040', '0000009040,', '1', 0, '在线文档', '在线文档', '1', '//swagger-ui.html', '', 'icon-book-open', '', 'sys:swagger', 80, '0', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
|
||||
commit;
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
-- 日志表新增执行时间字段
|
||||
ALTER TABLE ${_prefix}gen_table ADD COLUMN data_source_name varchar(64);
|
||||
COMMENT ON COLUMN ${_prefix}gen_table.data_source_name IS '数据源名称';
|
||||
|
||||
-- 新增在线文档Swagger菜单
|
||||
INSERT INTO ${_prefix}sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1044942498470014976', '0', '0,', '9040', '0000009040,', '1', 0, '在线文档', '在线文档', '1', '//swagger-ui.html', '', 'icon-book-open', '', 'sys:swagger', 80, '0', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
|
||||
commit;
|
||||
@@ -18,7 +18,7 @@ import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subMod
|
||||
* @author ${functionAuthor}
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@MyBatisDao
|
||||
@MyBatisDao<% if(table.dataSourceName != ''){ %>(dataSourceName="${table.dataSourceName}")<% } %>
|
||||
public interface ${ClassName}Dao extends ${table.isTreeEntity?'Tree':'Crud'}Dao<${ClassName}> {
|
||||
|
||||
}]]>
|
||||
|
||||
Reference in New Issue
Block a user