diff --git a/flyfish-web/src/main/java/com/flyfish/framework/beans/meta/BeanProperty.java b/flyfish-web/src/main/java/com/flyfish/framework/beans/meta/BeanProperty.java index dee2833..2a1d9d5 100644 --- a/flyfish-web/src/main/java/com/flyfish/framework/beans/meta/BeanProperty.java +++ b/flyfish-web/src/main/java/com/flyfish/framework/beans/meta/BeanProperty.java @@ -175,53 +175,6 @@ public class BeanProperty { // 优雅地处理校验 property.setValidation(ValidationCandidate.produce(annotations.annotations(), property.getType())); } - // 优雅地设置排序 -// MergedAnnotation order = annotations.get(Order.class); -// if (order.isPresent()) { -// property.setOrder(order.synthesize().value()); -// } else { -// property.setOrder(props.order()); -// } - // 追加生成属性 -// MergedAnnotation generation = annotations.get(Generation.class); -// if (generation.isPresent()) { -// -// } - // 追加属性映射 -// MergedAnnotation links = annotations.get(ComputedProps.List.class); -// if (links.isPresent()) { -// property.extra.put(BeanProps.LINKED, Arrays.stream( -// links.getAnnotationArray("value", ComputedProps.class) -// ).map(MergedAnnotation::asMap).collect(Collectors.toList())); -// } else { -// MergedAnnotation single = annotations.get(ComputedProps.class); -// if (single.isPresent()) { -// property.extra.put(BeanProps.LINKED, Collections.singletonList(single.asMap())); -// } -// } - // 优雅的设置额外的属性 -// MergedAnnotation item = annotations.get(FormItem.class); -// if (item.isPresent()) { -// applyFormItem(property, item.synthesize()); -// } - // 优雅的设置联动映射 -// MergedAnnotation mapping = annotations.get(MappedTo.class); -// if (mapping.isPresent()) { -// property.extra.put(BeanProps.MAPPING, mapping.asMap()); -// } - // 处理联动 -// MergedAnnotation condition = annotations.get(ConditionOn.List.class); -// if (condition.isPresent()) { -// property.extra.put(BeanProps.CONDITION, Arrays.stream( -// condition.getAnnotationArray("value", ConditionOn.class) -// ).map(MergedAnnotation::asMap).collect(Collectors.toList())); -// } else { -// MergedAnnotation single = annotations.get(ConditionOn.class); -// if (single.isPresent()) { -// property.extra.put(BeanProps.CONDITION, Collections.singletonList(single.asMap())); -// } -// } - Class clazz = descriptor.getPropertyType(); switch (property.getType()) { case STRING: @@ -252,27 +205,6 @@ public class BeanProperty { } }) .end(); - -// if (annotations.isPresent(DictValue.class)) { -// DictValue dictValue = annotations.get(DictValue.class).synthesize(); -// property.prop("code", dictValue.value()); -// } else if (annotations.isPresent(EnumValue.class)) { -// // 添加了枚举注解,自动注入类型,给前端使用 -// property.setType(BeanPropertyType.ENUM); -// EnumValue enumValue = annotations.get(EnumValue.class).synthesize(); -// String name = StringFormats.camel2Line(ClassUtils.getShortClassName(enumValue.value())); -// property.prop("code", name); -// } else if (annotations.isPresent(DBRefValue.class)) { - // 添加了数据库引用注解,自动注入类型给前端使用 -// DBRefValue dbRefValue = annotations.get(DBRefValue.class).synthesize(); -// Optional optional = processDbRef(dbRefValue.value()); -// if (optional.isPresent()) { -// property.setType(BeanPropertyType.DB_REF); -// property.prop("uri", optional.get()); -// } else { -// property.setType(BeanPropertyType.STRING); -// } -// } break; case NUMBER: if (null != field) { @@ -314,24 +246,6 @@ public class BeanProperty { property.prop("uri", ref).prop("mode", "multiple"); })) .end(); -// if (annotations.isPresent(SubBean.class)) { -// // 尝试获取泛型参数,存在时,赋值子表单 -// parseSubClass(field).ifPresent(subClazz -> property.setChildren(from(subClazz))); -// // 处理替换 -// applyReplacement(property, annotations); -// } else if (annotations.isPresent(DateRange.class)) { -// property.setType(BeanPropertyType.DATE); -// property -// .prop("type", "range") -// .prop("placeholder", Arrays.asList("开始时间", "结束时间")); -// } else if (annotations.isPresent(DBRefValue.class)) { -// // 添加了数据库引用注解,自动注入类型给前端使用 -// DBRefValue dbRefValue = annotations.get(DBRefValue.class).synthesize(); -// processDbRef(dbRefValue.value()).ifPresent(ref -> { -// property.setType(BeanPropertyType.DB_REF); -// property.prop("uri", ref).prop("mode", "multiple"); -// }); -// } } break; case OBJECT: @@ -344,12 +258,6 @@ public class BeanProperty { applyReplacement(property, value); }) .end(); - // 有子bean注解才处理 -// if (null != field && annotations.isPresent(SubBean.class)) { -// property.setChildren(from(clazz)); -// // 处理替换 -// applyReplacement(property, annotations); -// } break; case DB_REF: // 当存在db-ref时,解析为动态数据源 @@ -393,12 +301,6 @@ public class BeanProperty { } }) .end(); -// if (null != field) { -// if (annotations.isPresent(JsonFormat.class)) { -// String pattern = annotations.get(JsonFormat.class).synthesize().pattern(); -// -// } -// } } // 写入默认值 Object value = ReflectionUtils.getFieldValue(instance, property.name);