feat:增加查找替换逻辑
This commit is contained in:
parent
45dd39fd95
commit
973040f363
@ -0,0 +1,31 @@
|
||||
package com.flyfish.framework.annotations;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 联动属性声明
|
||||
* @author wangyu
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ComputedProps {
|
||||
|
||||
/**
|
||||
* 属性名
|
||||
* @return 结果
|
||||
*/
|
||||
String prop();
|
||||
|
||||
/**
|
||||
* 来自的字段值
|
||||
* @return 结果
|
||||
*/
|
||||
String field() default "";
|
||||
|
||||
/**
|
||||
* 表达式
|
||||
* @return 结果
|
||||
*/
|
||||
String expression() default "";
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
package com.flyfish.framework.annotations;
|
||||
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
|
@ -143,6 +143,11 @@ public class BeanProperty {
|
||||
property.extra.put(BeanProps.GENERATED, generation.asMap());
|
||||
property.extra.put(BeanProps.COMPONENT, "input-hidden");
|
||||
}
|
||||
// 追加属性映射
|
||||
MergedAnnotation<ComputedProps> links = annotations.get(ComputedProps.class);
|
||||
if (links.isPresent()) {
|
||||
property.extra.put(BeanProps.LINKED, links.asMap());
|
||||
}
|
||||
// 优雅的设置额外的属性
|
||||
MergedAnnotation<FormItem> item = annotations.get(FormItem.class);
|
||||
if (item.isPresent()) {
|
||||
|
@ -30,6 +30,8 @@ public interface BeanProps {
|
||||
|
||||
String GENERATED = "generated";
|
||||
|
||||
String LINKED = "links";
|
||||
|
||||
String MAPPING = "mapping";
|
||||
|
||||
String CONDITION = "condition";
|
||||
|
Loading…
Reference in New Issue
Block a user