<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:beans="http://www.springframework.org/schema/beans"
	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/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd">



	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<value>classpath:redis.properties</value>
				<value>classpath:application.properties</value>
			</list>
		</property>
	</bean>

	<import resource="spring-dubbo.xml" />
	<import resource="spring-mvc.xml" />
	<import resource="spring-redis.xml" />


	<!-- 添加注解驱动 -->
	<mvc:annotation-driven>
		<mvc:message-converters register-defaults="true">
			<!-- @ResponseBody乱码问题，将StringHttpMessageConverter的默认编码设为UTF-8 -->
			<beans:bean
				class="org.springframework.http.converter.StringHttpMessageConverter">
				<beans:constructor-arg value="UTF-8" />
			</beans:bean>
			<!-- 配置Fastjson支持 -->
			<beans:bean
				class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
				<beans:property name="charset" value="UTF-8" />
				<beans:property name="supportedMediaTypes">
					<beans:list>
						<beans:value>application/json</beans:value>
						<beans:value>text/html;charset=UTF-8</beans:value>
					</beans:list>
				</beans:property>
				<beans:property name="features">
					<beans:list>
						<beans:value>WriteMapNullValue</beans:value>
						<beans:value>QuoteFieldNames</beans:value>
						<beans:value>WriteDateUseDateFormat</beans:value>
						<beans:value>WriteEnumUsingToString</beans:value>
						<beans:value>DisableCircularReferenceDetect</beans:value>
						
					</beans:list>
				</beans:property>
			</beans:bean>
		</mvc:message-converters>
	</mvc:annotation-driven>

	<!-- 配置拦截器-->
	<mvc:interceptors> 
		<mvc:interceptor> 
			<mvc:mapping path="/api/**" />
			<bean class="com.huatek.torch.filter.CustomInterceptor"></bean>
		</mvc:interceptor>
	</mvc:interceptors> 
</beans>