Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fenghuo12
zheng
提交
4466f179
Z
zheng
项目概览
fenghuo12
/
zheng
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zheng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4466f179
编写于
2月 12, 2017
作者:
shuzheng5201314
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
数据源放到rpc-service,其他模块不连;增加generator配置
上级
5d5b81e9
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
129 addition
and
8 deletion
+129
-8
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java
...ng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java
+4
-4
zheng-cms/zheng-cms-dao/src/main/resources/generator.properties
...cms/zheng-cms-dao/src/main/resources/generator.properties
+4
-0
zheng-cms/zheng-cms-rpc-service/src/main/resources/applicationContext-jdbc.xml
...pc-service/src/main/resources/applicationContext-jdbc.xml
+0
-0
zheng-cms/zheng-cms-rpc-service/src/main/resources/jdbc.properties
.../zheng-cms-rpc-service/src/main/resources/jdbc.properties
+0
-0
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/Generator.java
...-upms-dao/src/main/java/com/zheng/upms/dao/Generator.java
+4
-4
zheng-upms/zheng-upms-dao/src/main/resources/generator.properties
...ms/zheng-upms-dao/src/main/resources/generator.properties
+4
-0
zheng-upms/zheng-upms-rpc-service/src/main/resources/applicationContext-jdbc.xml
...pc-service/src/main/resources/applicationContext-jdbc.xml
+113
-0
zheng-upms/zheng-upms-rpc-service/src/main/resources/jdbc.properties
...zheng-upms-rpc-service/src/main/resources/jdbc.properties
+0
-0
未找到文件。
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java
浏览文件 @
4466f179
...
...
@@ -11,10 +11,10 @@ public class Generator {
// 根据命名规范,只修改此常量值即可
private
static
String
MODULE_PREFIX_NAME
=
"cms"
;
private
static
String
JDBC_DRIVER
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.driver"
);
private
static
String
JDBC_URL
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.url"
);
private
static
String
JDBC_USERNAME
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.username"
);
private
static
String
JDBC_PASSWORD
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.password"
);
private
static
String
JDBC_DRIVER
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.driver"
);
private
static
String
JDBC_URL
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.url"
);
private
static
String
JDBC_USERNAME
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.username"
);
private
static
String
JDBC_PASSWORD
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.password"
);
/**
* 自动代码生成
...
...
zheng-cms/zheng-cms-dao/src/main/resources/generator.properties
0 → 100644
浏览文件 @
4466f179
generator.jdbc.driver
=
com.mysql.jdbc.Driver
generator.jdbc.url
=
jdbc
\:
mysql
\:
//127.0.0.1
\:
3306/zheng?useUnicode
\=
true&characterEncoding
\=
utf-8&autoReconnect
\=
true
generator.jdbc.username
=
root
generator.jdbc.password
=
rWd3Hb+AzNg3IXF1b5vD+g==
\ No newline at end of file
zheng-c
ommon
/src/main/resources/applicationContext-jdbc.xml
→
zheng-c
ms/zheng-cms-rpc-service
/src/main/resources/applicationContext-jdbc.xml
浏览文件 @
4466f179
文件已移动
zheng-cms/zheng-cms-
dao
/src/main/resources/jdbc.properties
→
zheng-cms/zheng-cms-
rpc-service
/src/main/resources/jdbc.properties
浏览文件 @
4466f179
文件已移动
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/Generator.java
浏览文件 @
4466f179
...
...
@@ -11,10 +11,10 @@ public class Generator {
// 根据命名规范,只修改此常量值即可
private
static
String
MODULE_PREFIX_NAME
=
"upms"
;
private
static
String
JDBC_DRIVER
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.driver"
);
private
static
String
JDBC_URL
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.url"
);
private
static
String
JDBC_USERNAME
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.username"
);
private
static
String
JDBC_PASSWORD
=
PropertiesFileUtil
.
getInstance
(
"
jdbc"
).
get
(
"maste
r.jdbc.password"
);
private
static
String
JDBC_DRIVER
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.driver"
);
private
static
String
JDBC_URL
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.url"
);
private
static
String
JDBC_USERNAME
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.username"
);
private
static
String
JDBC_PASSWORD
=
PropertiesFileUtil
.
getInstance
(
"
generator"
).
get
(
"generato
r.jdbc.password"
);
/**
* 自动代码生成
...
...
zheng-upms/zheng-upms-dao/src/main/resources/generator.properties
0 → 100644
浏览文件 @
4466f179
generator.jdbc.driver
=
com.mysql.jdbc.Driver
generator.jdbc.url
=
jdbc
\:
mysql
\:
//127.0.0.1
\:
3306/zheng?useUnicode
\=
true&characterEncoding
\=
utf-8&autoReconnect
\=
true
generator.jdbc.username
=
root
generator.jdbc.password
=
rWd3Hb+AzNg3IXF1b5vD+g==
\ No newline at end of file
zheng-upms/zheng-upms-rpc-service/src/main/resources/applicationContext-jdbc.xml
0 → 100644
浏览文件 @
4466f179
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop=
"http://www.springframework.org/schema/aop"
xmlns:tx=
"http://www.springframework.org/schema/tx"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"
>
<!-- 引入jdbc配置文件 -->
<!--<context:property-placeholder location="classpath:jdbc.properties" />-->
<!-- 配置进行解密 -->
<bean
id=
"propertyConfigurer"
class=
"com.zheng.common.plugin.EncryptPropertyPlaceholderConfigurer"
>
<property
name=
"locations"
>
<list>
<value>
classpath:jdbc.properties
</value>
<value>
classpath:redis.properties
</value>
</list>
</property>
</bean>
<!-- 主库数据源 -->
<bean
id=
"masterDataSource"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"driverClassName"
value=
"${master.jdbc.driver}"
/>
<property
name=
"url"
value=
"${master.jdbc.url}"
/>
<property
name=
"username"
value=
"${master.jdbc.username}"
/>
<property
name=
"password"
value=
"${master.jdbc.password}"
/>
<!-- 配置初始化大小、最小、最大 -->
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"maxActive"
value=
"20"
/>
<!-- 配置获取连接等待超时的时间 -->
<property
name=
"maxWait"
value=
"60000"
/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"300000"
/>
<!-- 校验语句 -->
<property
name=
"validationQuery"
value=
"SELECT 1"
/>
<property
name=
"testWhileIdle"
value=
"true"
/>
<property
name=
"testOnBorrow"
value=
"false"
/>
<property
name=
"testOnReturn"
value=
"false"
/>
<!-- 配置监控统计拦截的filters -->
<property
name=
"filters"
value=
"stat"
/>
</bean>
<!-- 从库数据源 -->
<bean
id=
"slaveDataSource"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"driverClassName"
value=
"${slave.jdbc.driver}"
/>
<property
name=
"url"
value=
"${slave.jdbc.url}"
/>
<property
name=
"username"
value=
"${slave.jdbc.username}"
/>
<property
name=
"password"
value=
"${slave.jdbc.password}"
/>
<!-- 配置初始化大小、最小、最大 -->
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"maxActive"
value=
"20"
/>
<!-- 配置获取连接等待超时的时间 -->
<property
name=
"maxWait"
value=
"60000"
/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"300000"
/>
<!-- 校验语句 -->
<property
name=
"validationQuery"
value=
"SELECT 1"
/>
<property
name=
"testWhileIdle"
value=
"true"
/>
<property
name=
"testOnBorrow"
value=
"false"
/>
<property
name=
"testOnReturn"
value=
"false"
/>
<!-- 配置监控统计拦截的filters -->
<property
name=
"filters"
value=
"stat"
/>
</bean>
<!-- 动态数据源 -->
<bean
id=
"dataSource"
class=
"com.zheng.common.db.DynamicDataSource"
>
<property
name=
"targetDataSources"
>
<map
key-type=
"java.lang.String"
>
<!-- 可配置多个数据源 -->
<entry
value-ref=
"masterDataSource"
key=
"masterDataSource"
></entry>
<entry
value-ref=
"slaveDataSource"
key=
"slaveDataSource"
></entry>
</map>
</property>
<property
name=
"defaultTargetDataSource"
ref=
"masterDataSource"
></property>
</bean>
<!-- 为Mybatis创建SqlSessionFactory,同时指定数据源 -->
<bean
id=
"sqlSessionFactory"
class=
"org.mybatis.spring.SqlSessionFactoryBean"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"configLocation"
value=
"classpath:mybatis-config.xml"
/>
<property
name=
"mapperLocations"
value=
"classpath*:**/mapper/*Mapper.xml"
/>
</bean>
<!-- Mapper接口所在包名,Spring会自动查找其下的Mapper -->
<bean
id=
"mapperScannerConfigurer"
class=
"org.mybatis.spring.mapper.MapperScannerConfigurer"
>
<property
name=
"basePackage"
value=
"**.mapper"
/>
<property
name=
"sqlSessionFactoryBeanName"
value=
"sqlSessionFactory"
/>
</bean>
<!-- 事务管理器 -->
<bean
id=
"transactionManager"
class=
"org.springframework.jdbc.datasource.DataSourceTransactionManager"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
</bean>
<!-- 启动注解事务 -->
<tx:annotation-driven
transaction-manager=
"transactionManager"
/>
</beans>
zheng-upms/zheng-upms-
dao
/src/main/resources/jdbc.properties
→
zheng-upms/zheng-upms-
rpc-service
/src/main/resources/jdbc.properties
浏览文件 @
4466f179
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录