RestConvert 增加 skipIgnore 功能
This commit is contained in:
@@ -127,9 +127,14 @@ public final class Rest {
|
|||||||
List<Class> types = new ArrayList<>();
|
List<Class> types = new ArrayList<>();
|
||||||
for (RestConvert rc : converts) {
|
for (RestConvert rc : converts) {
|
||||||
if (types.contains(rc.type())) throw new RuntimeException("@RestConvert type(" + rc.type() + ") repeat");
|
if (types.contains(rc.type())) throw new RuntimeException("@RestConvert type(" + rc.type() + ") repeat");
|
||||||
childFactory.register(rc.type(), false, rc.convertColumns());
|
if (rc.skipIgnore()) {
|
||||||
childFactory.register(rc.type(), true, rc.ignoreColumns());
|
childFactory.registerSkipIgnore(rc.type());
|
||||||
childFactory.reloadCoder(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());
|
types.add(rc.type());
|
||||||
childFactory.tiny(rc.tiny());
|
childFactory.tiny(rc.tiny());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public @interface RestConvert {
|
|||||||
|
|
||||||
boolean tiny() default true;
|
boolean tiny() default true;
|
||||||
|
|
||||||
|
boolean skipIgnore() default false;
|
||||||
|
|
||||||
Class type();
|
Class type();
|
||||||
|
|
||||||
String[] ignoreColumns() default {};
|
String[] ignoreColumns() default {};
|
||||||
|
|||||||
Reference in New Issue
Block a user