zhuguifei
2026-03-10 2c1fd10c6fbabb8e9f0e9f07fe66fb36c008e883
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:redis="http://www.springframework.org/schema/redis"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
       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/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/redis
    http://www.springframework.org/schema/redis/spring-redis.xsd
    http://www.springframework.org/schema/cache
    http://www.springframework.org/schema/cache/spring-cache.xsd
">
 
    <!-- 引入属性文件 -->
    <context:property-placeholder location="classpath:config.properties" />
 
    <!-- 自动扫描(自动注入) -->
    <!-- 扫描service -->
    <context:component-scan base-package="
    com.shlanbao.tzsc.base.dao,
    com.shlanbao.tzsc.*.service,
    com.shlanbao.tzsc.*.*.service,
    com.shlanbao.tzsc.*.*.*.service,
    com.shlanbao.tzsc.data.runtime.handler" />
    <!-- redis config -->
    <import resource="classpath:spring-redis.xml" />
 
    <!-- 1.开启注解AOP -->
    <aop:aspectj-autoproxy></aop:aspectj-autoproxy>
 
    <!-- 6.开启注解AOP (前提是引入aop命名空间和相关jar包) -->
    <aop:aspectj-autoproxy expose-proxy="true" proxy-target-class="true"></aop:aspectj-autoproxy>
 
    <!-- 7.开启aop,对类代理强制使用cglib代理 -->
    <aop:config proxy-target-class="true"></aop:config>
 
    <!-- 8.扫描 @Service @Component 注解-->
    <context:component-scan base-package="com.shlanbao.tzsc" >
        <!-- 不扫描 @Controller的类 -->
        <context:exclude-filter type="annotation"
                                expression="org.springframework.stereotype.Controller" />
    </context:component-scan>
 
</beans>