|
@@ -0,0 +1,57 @@
|
|
|
+<?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:c="http://www.springframework.org/schema/context"
|
|
|
+ xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
+ xmlns:task="http://www.springframework.org/schema/task"
|
|
|
+ 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.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
|
|
|
+
|
|
|
+
|
|
|
+ <!--扫描组件-->
|
|
|
+ <c:component-scan base-package="com.demo.wjj.service"/>
|
|
|
+
|
|
|
+ <!--配置文件-->
|
|
|
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
|
|
+ <property name="locations">
|
|
|
+ <list>
|
|
|
+ <value>classpath:application.properties</value>
|
|
|
+ <value>classpath:jdbc.properties</value>
|
|
|
+ </list>
|
|
|
+ </property>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <!--数据源-->
|
|
|
+ <bean id="datasource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
|
|
|
+ <property name="driverClassName" value="${jdbc.driverName}"/>
|
|
|
+ <property name="url" value="${jdbc.url}"/>
|
|
|
+ <property name="username" value="${jdbc.username}"/>
|
|
|
+ <property name="password" value="${jdbc.password}"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <!--事务管理-->
|
|
|
+ <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
|
|
+ <property name="dataSource" ref="datasource"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <tx:annotation-driven/>
|
|
|
+
|
|
|
+ <import resource="mybatis-beans.xml"/>
|
|
|
+
|
|
|
+ <!--短信发送服务-->
|
|
|
+ <bean id="smsSendService" class="com.demo.wjj.service.impl.SmsSendServiceImpl">
|
|
|
+ <property name="url" value="${sms.url}"/>
|
|
|
+ <property name="name" value="${sms.username}"/>
|
|
|
+ <property name="pwd" value="${sms.password}"/>
|
|
|
+ <property name="sign" value="${sms.code.sign}"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <bean class="com.demo.wjj.service.impl.ValidateCodeServiceImpl">
|
|
|
+ <property name="smsSendService" ref="smsSendService"/>
|
|
|
+ <property name="template" value="${sms.code.template}"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <!-- 定时任务 -->
|
|
|
+ <task:annotation-driven scheduler="qbScheduler" mode="proxy"/>
|
|
|
+ <task:scheduler id="qbScheduler" />
|
|
|
+
|
|
|
+</beans>
|