Commit c98f9d94 authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

[DEV] delete email bean config

See merge request root/atms!53
parents 38b8c3b9 59ba591d
......@@ -163,13 +163,6 @@
<artifactId>druid</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.2.jre7</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
......
package pwc.taxtech.atms;
public interface MyMailMapper {
}
......@@ -36,13 +36,4 @@ public class MybatisConfig implements InitializingBean {
return bean;
}
@Bean
public static MapperScannerConfigurer userMapperConfigurerMail() {
MapperScannerConfigurer bean = new MapperScannerConfigurer();
bean.setMarkerInterface(MyMailMapper.class);
bean.setBasePackage(BASE_PACKAGE);
bean.setSqlSessionTemplateBeanName("sqlSessionTemplateMail");
// bean.setSqlSessionFactoryBeanName("sqlSessionFactoryMail");
return bean;
}
}
package pwc.taxtech.atms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMailMapper;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entitiy.MailQueue;
import pwc.taxtech.atms.entitiy.MailQueueExample;
import java.util.List;
@Mapper
public interface MailQueueMapper extends MyMailMapper {
public interface MailQueueMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dbo.MAILQUEUE
......
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- DruidDataSource数据源配置) -->
<!-- See: https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_DruidDataSource%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE -->
<bean id="dataSourceMail" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${mail_jdbc_url}" />
<property name="username" value="${mail_jdbc_user}" />
<property name="password" value="${mail_jdbc_password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="${atms.config.druid.initialSize:0}" />
<property name="minIdle" value="${atms.config.druid.minIdle:1}" />
<property name="maxActive" value="${atms.config.druid.maxActive:20}" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="${atms.config.druid.maxWait:60000}" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="${atms.config.druid.timeBetweenEvictionRunsMillis:60000}" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="${atms.config.druid.minEvictableIdleTimeMillis:300000}" />
<property name="validationQuery" value="${jdbc_validationQuery:select 1 from INFORMATION_SCHEMA.SYSTEM_USERS}" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize"
value="20" />
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat" />
</bean>
</beans>
\ No newline at end of file
......@@ -32,7 +32,6 @@
</context:component-scan>
<import resource="applicationContext-datasource.xml" />
<import resource="applicationContext-datasource-mail.xml" />
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
......@@ -47,20 +46,6 @@
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory" />
</bean>
<bean id="sqlSessionFactoryMail" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSourceMail" />
<property name="configLocation" value="classpath:sqlMapConfig.xml" />
<property name="mapperLocations">
<array>
<value>classpath:pwc/taxtech/atms/dao/*Mapper.xml</value>
</array>
</property>
</bean>
<bean id="sqlSessionTemplateMail" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactoryMail" />
</bean>
<!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> -->
......
package pwc.taxtech.atms.service.impl;
import java.util.Date;
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dao.MailQueueMapper;
import pwc.taxtech.atms.dto.MailMto;
import pwc.taxtech.atms.entitiy.MailQueue;
import pwc.taxtech.atms.service.CommonService;
import java.util.Date;
public class MailServiceIT extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(MailServiceIT.class);
@Autowired
private CommonService commonService;
@Autowired
private MailQueueMapper mailQueueMapper;
@Resource
private SqlSessionTemplate sqlSessionTemplateMail;
@Before
public void setUp() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment