feat:增加金钱验证类型和输入框

This commit is contained in:
wangyu 2021-09-28 11:46:25 +08:00
parent ebeab9658f
commit a2aaec96e5
2 changed files with 12 additions and 1 deletions

View File

@ -75,7 +75,15 @@ public @interface Property {
/**
* 表单注解
*
* @return 表单注解仅用于构造器
*/
FormItem[] form() default {};
/**
* 表单映射
*
* @return 映射的注解仅用于构造器
*/
MappedTo[] mapping() default {};
}

View File

@ -143,7 +143,6 @@ public class BeanProperty {
MergedAnnotation<MappedTo> mapping = annotations.get(MappedTo.class);
if (mapping.isPresent()) {
property.extra.put("mapping", mapping.asMap());
MappedTo mappedTo = mapping.synthesize();
}
// 优雅的处理校验
property.setValidation(ValidationCandidate.produce(annotations));
@ -321,6 +320,10 @@ public class BeanProperty {
if (ArrayUtils.isNotEmpty(prop.form())) {
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();
} else {