From eb92cb3e53eb79a471d4292cf6d5fc81d82058ea Mon Sep 17 00:00:00 2001 From: zjh <2019548171@qq.com> Date: Wed, 22 Apr 2026 09:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E5=87=BA=E4=BF=A1=E6=81=AF=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ffms-SpringProject/src/bean-aop.xml | 9 +++ .../src/com/ssm/aop/xml/Expense.java | 59 +++++++++++++++++++ .../src/com/ssm/aop/xml/TestAop.java | 2 + 3 files changed, 70 insertions(+) create mode 100644 ffms-SpringProject/src/com/ssm/aop/xml/Expense.java diff --git a/ffms-SpringProject/src/bean-aop.xml b/ffms-SpringProject/src/bean-aop.xml index f3f39c6..547043b 100644 --- a/ffms-SpringProject/src/bean-aop.xml +++ b/ffms-SpringProject/src/bean-aop.xml @@ -37,6 +37,15 @@ + + + + + + + + + diff --git a/ffms-SpringProject/src/com/ssm/aop/xml/Expense.java b/ffms-SpringProject/src/com/ssm/aop/xml/Expense.java new file mode 100644 index 0000000..3e9250b --- /dev/null +++ b/ffms-SpringProject/src/com/ssm/aop/xml/Expense.java @@ -0,0 +1,59 @@ +package com.ssm.aop.xml; + +public class Expense { + private Integer id; + private Integer userId; + private String type; + private double money; + private String expenseTime; + + public void printInfo(){ + System.out.println("=====赵晋鹤-支出信息====="); + System.out.println("支出ID:"+id); + System.out.println("用户ID:"+userId); + System.out.println("支出类型:"+type); + System.out.println("金额:"+money); + System.out.println("时间:"+expenseTime); + } + + // 👇 以下是必须的 getter 和 setter + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public double getMoney() { + return money; + } + + public void setMoney(double money) { + this.money = money; + } + + public String getExpenseTime() { + return expenseTime; + } + + public void setExpenseTime(String expenseTime) { + this.expenseTime = expenseTime; + } +} \ No newline at end of file diff --git a/ffms-SpringProject/src/com/ssm/aop/xml/TestAop.java b/ffms-SpringProject/src/com/ssm/aop/xml/TestAop.java index 1665008..0bde1fe 100644 --- a/ffms-SpringProject/src/com/ssm/aop/xml/TestAop.java +++ b/ffms-SpringProject/src/com/ssm/aop/xml/TestAop.java @@ -12,5 +12,7 @@ public class TestAop { stockAccount.printInfo(); Income income = (Income)ac.getBean("income"); income.printInfo(); + Expense expense = (Expense)ac.getBean("expense"); + expense.printInfo(); } } \ No newline at end of file