From 1845d8e87a702c262632e9f2afd33d35ec907afd Mon Sep 17 00:00:00 2001 From: Administrator <549477611@qq.com> Date: Thu, 27 Sep 2018 14:31:13 +0800 Subject: [PATCH] bug commit --- .../service/compensate/JdbcCompensationServiceImpl.java | 4 +++- .../com/hmily/tcc/admin/spi/CompensationConfiguration.java | 7 ++----- hmily-tcc-admin/src/main/resources/application-db.yml | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/service/compensate/JdbcCompensationServiceImpl.java b/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/service/compensate/JdbcCompensationServiceImpl.java index 85d64a82..01d42d6f 100644 --- a/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/service/compensate/JdbcCompensationServiceImpl.java +++ b/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/service/compensate/JdbcCompensationServiceImpl.java @@ -30,6 +30,7 @@ import com.hmily.tcc.common.utils.RepositoryPathUtils; import lombok.RequiredArgsConstructor; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import java.util.List; @@ -45,7 +46,8 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class JdbcCompensationServiceImpl implements CompensationService { - private final JdbcTemplate jdbcTemplate; + @Autowired + private JdbcTemplate jdbcTemplate; private String dbType; diff --git a/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/spi/CompensationConfiguration.java b/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/spi/CompensationConfiguration.java index 1f434e08..5e653790 100644 --- a/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/spi/CompensationConfiguration.java +++ b/hmily-tcc-admin/src/main/java/com/hmily/tcc/admin/spi/CompensationConfiguration.java @@ -73,12 +73,9 @@ public class CompensationConfiguration { private final Environment env; - private final JdbcTemplate jdbcTemplate; - @Autowired - JdbcRecoverConfiguration(final Environment env, final JdbcTemplate jdbcTemplate) { + JdbcRecoverConfiguration(final Environment env) { this.env = env; - this.jdbcTemplate = jdbcTemplate; } @Bean @@ -98,7 +95,7 @@ public class CompensationConfiguration { @Bean @Qualifier("jdbcTransactionRecoverService") public CompensationService jdbcTransactionRecoverService() { - JdbcCompensationServiceImpl jdbcTransactionRecoverService = new JdbcCompensationServiceImpl(jdbcTemplate); + JdbcCompensationServiceImpl jdbcTransactionRecoverService = new JdbcCompensationServiceImpl(); jdbcTransactionRecoverService.setDbType(env.getProperty("compensation.db.driver")); return jdbcTransactionRecoverService; } diff --git a/hmily-tcc-admin/src/main/resources/application-db.yml b/hmily-tcc-admin/src/main/resources/application-db.yml index 9f7010de..2bd6159f 100644 --- a/hmily-tcc-admin/src/main/resources/application-db.yml +++ b/hmily-tcc-admin/src/main/resources/application-db.yml @@ -1,6 +1,6 @@ compensation: db: driver : com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.68:3306/tx?useUnicode=true&characterEncoding=utf8 - username: xiaoyu - password: Wgj@555888 + url: jdbc:mysql://192.168.1.98:3306/tcc?useUnicode=true&characterEncoding=utf8 + username: root + password: 123456