[DEV] better zod export
This commit is contained in:
parent
c13f910620
commit
e1d9da70c8
@ -12,4 +12,6 @@ import org.kar.archidata.dataAccess.options.CheckFunctionVoid;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface DataJson {
|
public @interface DataJson {
|
||||||
Class<? extends CheckFunctionInterface> checker() default CheckFunctionVoid.class;
|
Class<? extends CheckFunctionInterface> checker() default CheckFunctionVoid.class;
|
||||||
|
|
||||||
|
Class<?> targetEntity() default Void.class;
|
||||||
}
|
}
|
||||||
|
@ -296,13 +296,24 @@ public class DataFactoryTsApi {
|
|||||||
}
|
}
|
||||||
final Class<?> parameterType = parameter.getType();
|
final Class<?> parameterType = parameter.getType();
|
||||||
String parameterTypeString;
|
String parameterTypeString;
|
||||||
|
final Class<?> asyncType = apiAnnotationGetAsyncType(parameter);
|
||||||
if (parameterType == List.class) {
|
if (parameterType == List.class) {
|
||||||
LOGGER.warn("Detext List param ==> not managed type ==> any[] !!!");
|
if (asyncType == null) {
|
||||||
parameterTypeString = "any[]";
|
LOGGER.warn("Detext List param ==> not managed type ==> any[] !!!");
|
||||||
} else {
|
parameterTypeString = "any[]";
|
||||||
|
} else {
|
||||||
|
final ClassElement tmp = DataFactoryZod.createTable(asyncType, previous);
|
||||||
|
includeModel.add(tmp.model[0]);
|
||||||
|
parameterTypeString = tmp.tsTypeName + "[]";
|
||||||
|
}
|
||||||
|
} else if (asyncType == null) {
|
||||||
final ClassElement tmp = DataFactoryZod.createTable(parameterType, previous);
|
final ClassElement tmp = DataFactoryZod.createTable(parameterType, previous);
|
||||||
includeModel.add(tmp.model[0]);
|
includeModel.add(tmp.model[0]);
|
||||||
parameterTypeString = tmp.tsTypeName;
|
parameterTypeString = tmp.tsTypeName;
|
||||||
|
} else {
|
||||||
|
final ClassElement tmp = DataFactoryZod.createTable(asyncType, previous);
|
||||||
|
includeModel.add(tmp.model[0]);
|
||||||
|
parameterTypeString = tmp.tsTypeName;
|
||||||
}
|
}
|
||||||
final String pathParam = apiAnnotationGetPathParam(parameter);
|
final String pathParam = apiAnnotationGetPathParam(parameter);
|
||||||
final String queryParam = apiAnnotationGetQueryParam(parameter);
|
final String queryParam = apiAnnotationGetQueryParam(parameter);
|
||||||
@ -313,21 +324,18 @@ public class DataFactoryTsApi {
|
|||||||
pathParams.put(pathParam, parameterTypeString);
|
pathParams.put(pathParam, parameterTypeString);
|
||||||
} else if (formDataParam != null) {
|
} else if (formDataParam != null) {
|
||||||
formDataParams.put(formDataParam, parameterTypeString);
|
formDataParams.put(formDataParam, parameterTypeString);
|
||||||
|
} else if (asyncType != null) {
|
||||||
|
final ClassElement tmp = DataFactoryZod.createTable(asyncType, previous);
|
||||||
|
includeModel.add(tmp.model[0]);
|
||||||
|
emptyElement.add(tmp.tsTypeName);
|
||||||
|
} else if (parameterType == List.class) {
|
||||||
|
parameterTypeString = "any[]";
|
||||||
|
final Class<?> plop = parameterType.arrayType();
|
||||||
|
LOGGER.info("ArrayType = {}", plop);
|
||||||
} else {
|
} else {
|
||||||
final Class<?> asyncType = apiAnnotationGetAsyncType(parameter);
|
final ClassElement tmp = DataFactoryZod.createTable(parameterType, previous);
|
||||||
if (asyncType != null) {
|
includeModel.add(tmp.model[0]);
|
||||||
final ClassElement tmp = DataFactoryZod.createTable(asyncType, previous);
|
emptyElement.add(tmp.tsTypeName);
|
||||||
includeModel.add(tmp.model[0]);
|
|
||||||
emptyElement.add(tmp.tsTypeName);
|
|
||||||
} else if (parameterType == List.class) {
|
|
||||||
parameterTypeString = "any[]";
|
|
||||||
final Class<?> plop = parameterType.arrayType();
|
|
||||||
LOGGER.info("ArrayType = {}", plop);
|
|
||||||
} else {
|
|
||||||
final ClassElement tmp = DataFactoryZod.createTable(parameterType, previous);
|
|
||||||
includeModel.add(tmp.model[0]);
|
|
||||||
emptyElement.add(tmp.tsTypeName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!queryParams.isEmpty()) {
|
if (!queryParams.isEmpty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user