...
|
...
|
@@ -30,19 +30,20 @@ |
|
|
</list>
|
|
|
</property>
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
<!-- 服务错误码异常处理 -->
|
|
|
<bean class="com.yoho.error.exception.handler.ServiceGlobalExceptionHandler" />
|
|
|
|
|
|
<!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
|
|
|
<mvc:annotation-driven>
|
|
|
<mvc:message-converters>
|
|
|
<ref bean="stringConverter" />
|
|
|
<ref bean="jsonConverter" />
|
|
|
</mvc:message-converters>
|
|
|
</mvc:annotation-driven>
|
|
|
|
|
|
|
|
|
<!-- controller耗时的监听器 -->
|
|
|
<bean id="controllerInterceptor" class="com.yoho.search.interceptor.ControllerInterceptor"/>
|
|
|
<mvc:interceptors>
|
|
|
<!-- 使用bean定义一个Interceptor,直接定义在mvc:interceptors根下面的Interceptor将拦截所有的请求 -->
|
|
|
<mvc:interceptor>
|
|
|
<mvc:mapping path="/**"/>
|
|
|
<!-- 需排除拦截的地址 -->
|
|
|
<mvc:exclude-mapping path="/" />
|
|
|
<mvc:exclude-mapping path="/test" />
|
|
|
<ref bean="controllerInterceptor"/>
|
|
|
</mvc:interceptor>
|
|
|
</mvc:interceptors>
|
|
|
|
|
|
<mvc:interceptors>
|
|
|
<ref bean="threadProfileInterceptor"/>
|
|
|
</mvc:interceptors>
|
...
|
...
|
@@ -57,7 +58,6 @@ |
|
|
</property>
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
<!-- json转换器 application/json -->
|
|
|
<bean id="jsonConverter"
|
|
|
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
|
...
|
...
|
@@ -65,23 +65,26 @@ |
|
|
<array value-type="com.alibaba.fastjson.serializer.SerializerFeature">
|
|
|
<value>DisableCircularReferenceDetect</value>
|
|
|
<value>WriteMapNullValue</value>
|
|
|
|
|
|
</array>
|
|
|
</property>
|
|
|
</bean>
|
|
|
|
|
|
<!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
|
|
|
<mvc:annotation-driven>
|
|
|
<mvc:message-converters>
|
|
|
<ref bean="stringConverter" />
|
|
|
<ref bean="jsonConverter" />
|
|
|
</mvc:message-converters>
|
|
|
</mvc:annotation-driven>
|
|
|
|
|
|
<!--service接口调用拦截器-->
|
|
|
<bean id="serviceMethodInterceptor" class="com.yoho.core.common.monitor.interceptor.MethodProfileInterceptor">
|
|
|
</bean>
|
|
|
<bean id="serviceMethodInterceptor" class="com.yoho.core.common.monitor.interceptor.MethodProfileInterceptor"/>
|
|
|
<aop:config>
|
|
|
<aop:pointcut id="serviceMethodPoint"
|
|
|
expression="(execution(* com.yoho.*.*.service.*.*(..))) or (execution(* com.yoho.*.*.service.impl.*.*(..))) or (execution(* com.yoho.*.*.restapi.*.*(..)))
|
|
|
"/>
|
|
|
<aop:pointcut id="serviceMethodPoint" expression="(execution(* com.yoho.*.*.service.*.*(..))) or (execution(* com.yoho.*.*.service.impl.*.*(..))) or (execution(* com.yoho.*.*.restapi.*.*(..)))"/>
|
|
|
<aop:advisor pointcut-ref="serviceMethodPoint" advice-ref="serviceMethodInterceptor"/>
|
|
|
</aop:config>
|
|
|
|
|
|
<bean id="applicationContextUtil" class="com.yoho.search.utils.ApplicationContextUtil">
|
|
|
</bean>
|
|
|
<!-- Redis 配置 end -->
|
|
|
|
|
|
|
|
|
<bean id="serviceGlobalExceptionHandler" class="com.yoho.error.exception.handler.ServiceGlobalExceptionHandler" />
|
|
|
<bean id="applicationContextUtil" class="com.yoho.search.utils.ApplicationContextUtil"></bean>
|
|
|
|
|
|
</beans> |
|
|
\ No newline at end of file |
...
|
...
|
|