You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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: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/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 1. 配置所有实体类Bean -->
<bean id="user" class="com.ssm.aop.xml.User">
<property name="username" value="daiyuhang"/>
<property name="userpass" value="123456"/>
<property name="truename" value="代宇航"/>
<property name="age" value="20"/>
<property name="role" value="管理员"/>
</bean>
<bean id="material" class="com.ssm.aop.xml.Material">
<property name="materialId" value="M001"/>
<property name="materialName" value="试管"/>
<property name="type" value="玻璃耗材"/>
<property name="stock" value="100"/>
<property name="unit" value="个"/>
</bean>
<bean id="nowDate" class="java.util.Date"/>
<bean id="startDate" class="java.util.Date"/>
<bean id="endDate" class="java.util.Date"/>
<bean id="materialRecord" class="com.ssm.aop.xml.MaterialRecord">
<property name="recordId" value="R001"/>
<property name="materialId" value="M001"/>
<property name="operator" value="喻廷屿"/>
<property name="nums" value="20"/>
<property name="operateDate" ref="nowDate"/>
<property name="type" value="入库"/>
</bean>
<bean id="appointment" class="com.ssm.aop.xml.Appointment">
<property name="appointmentId" value="A001"/>
<property name="username" value="孙佳兴"/>
<property name="labId" value="L001"/>
<property name="startTime" ref="startDate"/>
<property name="endTime" ref="endDate"/>
<property name="purpose" value="化学实验"/>
</bean>
<bean id="laboratory" class="com.ssm.aop.xml.Laboratory">
<property name="labId" value="L001"/>
<property name="labName" value="化学实验室1号"/>
<property name="location" value="实验楼3楼"/>
<property name="capacity" value="30"/>
<property name="status" value="空闲"/>
</bean>
<!-- 2. 配置日志通知类Bean -->
<bean id="log" class="com.ssm.aop.xml.Log"/>
<!-- 3. AOP配置切面、切入点、前置通知 -->
<aop:config>
<!-- 定义切面,切面=通知类+切入点 -->
<aop:aspect ref="log">
<!-- 定义切入点匹配com.ssm.aop.xml包下所有类的printInfo()方法 -->
<aop:pointcut id="printInfoPointcut" expression="execution(* com.ssm.aop.xml.*.printInfo(..))"/>
<!-- 前置通知在切入点方法执行前调用beforeLog方法 -->
<aop:before method="beforeLog" pointcut-ref="printInfoPointcut"/>
</aop:aspect>
</aop:config>
</beans>