feat:增加金钱验证类型和输入框
This commit is contained in:
parent
ebeab9658f
commit
a2aaec96e5
@ -75,7 +75,15 @@ public @interface Property {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 表单注解
|
* 表单注解
|
||||||
|
*
|
||||||
* @return 表单注解,仅用于构造器
|
* @return 表单注解,仅用于构造器
|
||||||
*/
|
*/
|
||||||
FormItem[] form() default {};
|
FormItem[] form() default {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单映射
|
||||||
|
*
|
||||||
|
* @return 映射的注解,仅用于构造器
|
||||||
|
*/
|
||||||
|
MappedTo[] mapping() default {};
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,6 @@ public class BeanProperty {
|
|||||||
MergedAnnotation<MappedTo> mapping = annotations.get(MappedTo.class);
|
MergedAnnotation<MappedTo> mapping = annotations.get(MappedTo.class);
|
||||||
if (mapping.isPresent()) {
|
if (mapping.isPresent()) {
|
||||||
property.extra.put("mapping", mapping.asMap());
|
property.extra.put("mapping", mapping.asMap());
|
||||||
MappedTo mappedTo = mapping.synthesize();
|
|
||||||
}
|
}
|
||||||
// 优雅的处理校验
|
// 优雅的处理校验
|
||||||
property.setValidation(ValidationCandidate.produce(annotations));
|
property.setValidation(ValidationCandidate.produce(annotations));
|
||||||
@ -321,6 +320,10 @@ public class BeanProperty {
|
|||||||
if (ArrayUtils.isNotEmpty(prop.form())) {
|
if (ArrayUtils.isNotEmpty(prop.form())) {
|
||||||
applyFormItem(property, prop.form()[0]);
|
applyFormItem(property, prop.form()[0]);
|
||||||
}
|
}
|
||||||
|
// 处理额外的映射
|
||||||
|
if (ArrayUtils.isNotEmpty(prop.mapping())) {
|
||||||
|
property.extra.put("mapping", MergedAnnotations.from(prop.mapping()).get(MappedTo.class).asMap());
|
||||||
|
}
|
||||||
// 设置标题
|
// 设置标题
|
||||||
property.title = prop.title();
|
property.title = prop.title();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user