private static ActionControllerLog giveController(JoinPoint joinPoint) throws Exception {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if(method != null) {
return method.getAnnotation(ActionControllerLog.class);
}
return null;
}
```
其中注解为
```
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ActionControllerLog {
/** 标题 */
String title() default "";
/** 动作的名称 */
String action() default "";
/** 是否保存请求的参数 */
boolean isSaveRequestData() default false;
/** 渠道 */
String channel() default "web";
}
```
网友评论