bug commit

This commit is contained in:
Administrator 2018-09-27 14:31:13 +08:00
parent bc5afb091f
commit 1845d8e87a
3 changed files with 8 additions and 9 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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