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 cd7ced2..476af95 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 @@ -226,6 +226,13 @@ public class BeanProperty { 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("multiple", "true"); + }); } } break;