RestConvert 增加 skipIgnore 功能

This commit is contained in:
Redkale
2017-11-04 10:47:40 +08:00
parent d2aacf7b8c
commit 4f3c2e071a
2 changed files with 10 additions and 3 deletions

View File

@@ -127,9 +127,14 @@ public final class Rest {
List<Class> types = new ArrayList<>();
for (RestConvert rc : converts) {
if (types.contains(rc.type())) throw new RuntimeException("@RestConvert type(" + rc.type() + ") repeat");
childFactory.register(rc.type(), false, rc.convertColumns());
childFactory.register(rc.type(), true, rc.ignoreColumns());
childFactory.reloadCoder(rc.type());
if (rc.skipIgnore()) {
childFactory.registerSkipIgnore(rc.type());
childFactory.reloadCoder(rc.type());
} else {
childFactory.register(rc.type(), false, rc.convertColumns());
childFactory.register(rc.type(), true, rc.ignoreColumns());
childFactory.reloadCoder(rc.type());
}
types.add(rc.type());
childFactory.tiny(rc.tiny());
}

View File

@@ -26,6 +26,8 @@ public @interface RestConvert {
boolean tiny() default true;
boolean skipIgnore() default false;
Class type();
String[] ignoreColumns() default {};