package com.gxa.bj.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
/**
* 这是一个切面的类
* @author Administrator
*
*/
public class ZhuangBei {
//增强方法前调用
public void before(){
System.out.println("选择一件装备");
}
/**
* 正在加强的方法
* @param joinPoint
* @return
* @throws Throwable
*/
public Object around(ProceedingJoinPoint joinPoint) throws Throwable{
Object result = joinPoint.proceed();
System.out.println("正在加强的方法");
System.out.println("杀伤力增加两倍,防御力增加两倍");
return result;
}
public void after(){
System.out.println("装备使用完毕");
}
}
import org.aspectj.lang.ProceedingJoinPoint;
/**
* 这是一个切面的类
* @author Administrator
*
*/
public class ZhuangBei {
//增强方法前调用
public void before(){
System.out.println("选择一件装备");
}
/**
* 正在加强的方法
* @param joinPoint
* @return
* @throws Throwable
*/
public Object around(ProceedingJoinPoint joinPoint) throws Throwable{
Object result = joinPoint.proceed();
System.out.println("正在加强的方法");
System.out.println("杀伤力增加两倍,防御力增加两倍");
return result;
}
public void after(){
System.out.println("装备使用完毕");
}
}