@Target(value={METHOD,PARAMETER,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface AutoOperate
Declare the return value or parameter of the method(if the method is annotated by ArgAutoOperate) need process.
ArgAutoOperate,
cn.crane4j.springboot.support.aop.MethodResultAutoOperateAspect,
cn.crane4j.springboot.support.aop.MethodArgumentAutoOperateAspect| 限定符和类型 | 必需的元素和说明 |
|---|---|
Class<?> |
type
The object type to be processed in the return value of the method.
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
condition
The expression of apply condition.
|
String[] |
excludes
The group of operations not to be performed.
|
Class<?> |
executor
The type of the operation executor to be used.
|
String |
executorName
The name of the executor to be used.
|
String[] |
includes
The group of operations to be performed.
|
String |
on
When the return value is a wrapper class,
we can specify to obtain the data set to be processed
from the specific field of the wrapper class, and then process it。
|
Class<?> |
parser
The type of the operation parser to be used.
|
String |
parserName
The name of the operation parser to be used.
|
String |
value
When used in
ArgAutoOperate, it is used to bind the corresponding parameter name. |
public abstract String value
ArgAutoOperate, it is used to bind the corresponding parameter name.public abstract String on
When the return value is a wrapper class,
we can specify to obtain the data set to be processed
from the specific field of the wrapper class, and then process it。
This configuration is generally used to process the method
of returning the general response body in the Controller。
For example:
// general response public static class Result{ private Integer code; private T data; // objects to be processed } // process general response
public abstract Class<?> executor
public abstract String executorName
public abstract Class<?> parser
public abstract String parserName
public abstract String[] includes
public abstract String[] excludes
The group of operations not to be performed.
The priority of this configuration is higher than includes()
public abstract String condition
The expression of apply condition.
The operation will only be performed when the expression result is true or "true" string。
The following variables can be used by default in the expression:
@beanName:beans in spring context;#parameterName: arguments of method;#result: return value of method;cn.crane4j.springboot.support.aop.MethodResultAutoOperateAspect#methodBaseExpressionEvaluatorCopyright © 2023. All rights reserved.