修改接口字段类型判断

pull/22/head
rays 2021-10-13 18:30:33 +08:00
parent 27fd5f5531
commit 1bda25f639
1 changed files with 12 additions and 1 deletions

View File

@ -424,7 +424,7 @@ public class ApiResourceServiceImpl extends ServiceImpl<ApiResourceMapper, ApiRe
item.setFieldType("list");
} else if (fieldMetadata.getFieldClassPath().contains("java.io")) {
item.setFieldType("file");
} else if (fieldMetadata.getFieldClassPath().contains("java.")) {
} else if (fieldMetadata.getFieldClassPath().contains("java.") || this.getBasicTypeName().stream().anyMatch(typeName -> fieldMetadata.getFieldClassPath().equalsIgnoreCase(typeName))) {
item.setFieldType("string");
} else {
item.setFieldType("object");
@ -485,4 +485,15 @@ public class ApiResourceServiceImpl extends ServiceImpl<ApiResourceMapper, ApiRe
return false;
}
/**
*
*
* @return {@link List< String>}
* @author majianguo
* @date 2021/10/13 18:21
**/
private List<String> getBasicTypeName() {
return Arrays.asList("int", "short", "double", "float", "long", "boolean", "char", "byte");
}
}