【7.6.0】【scanner】修改调用新的扫描类

pull/55/head
fengshuonan 2023-05-07 10:46:42 +08:00
parent 2e154f6590
commit 31a6011f4b
4 changed files with 8 additions and 9 deletions

View File

@ -2,8 +2,8 @@ package cn.stylefeng.roses.kernel.scanner.api.context;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
import cn.stylefeng.roses.kernel.rule.util.ClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.enums.ParamTypeEnum;
import cn.stylefeng.roses.kernel.scanner.api.util.AdvancedClassTypeUtil;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@ -75,7 +75,7 @@ public class MetadataContext {
Set<String> classRecords = META_DATA_CLASS_COUNT_CONTEXT.get(uuid);
if (classRecords != null) {
// 获取字段类型如果是数组collection带实体的需要获取真实的实体类型
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
// 如果是对象类型,直接判断
if (classFieldType.equals(FieldTypeEnum.OBJECT)) {

View File

@ -1,10 +1,10 @@
package cn.stylefeng.roses.kernel.scanner.api.factory;
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
import cn.stylefeng.roses.kernel.rule.util.ClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.constants.ScannerConstants;
import cn.stylefeng.roses.kernel.scanner.api.context.MetadataContext;
import cn.stylefeng.roses.kernel.scanner.api.pojo.resource.FieldMetadata;
import cn.stylefeng.roses.kernel.scanner.api.util.AdvancedClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.util.ClassDescriptionUtil;
import cn.stylefeng.roses.kernel.scanner.api.util.FieldDescriptionUtil;
import lombok.extern.slf4j.Slf4j;
@ -35,7 +35,7 @@ public class ClassDetailMetadataFactory {
public static Set<FieldMetadata> createFieldDetailMetadataSet(Type fieldType, String uuid) {
// 获取参数的类型枚举
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(fieldType);
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(fieldType);
// 设置响应结果
Set<FieldMetadata> fieldMetadata = null;
@ -158,7 +158,7 @@ public class ClassDetailMetadataFactory {
// 如果是T这种形式应该将当前fieldMetadata的类型改为泛型的类型例如参数genericType是List时候
if (FieldTypeEnum.WITH_UNKNOWN_GENERIC.getCode().equals(fieldMetadata.getFieldType())) {
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
fieldMetadata.setFieldType(classFieldType.getCode());
}
}

View File

@ -1,8 +1,8 @@
package cn.stylefeng.roses.kernel.scanner.api.factory;
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
import cn.stylefeng.roses.kernel.rule.util.ClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.pojo.resource.FieldMetadata;
import cn.stylefeng.roses.kernel.scanner.api.util.AdvancedClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.util.ClassDescriptionUtil;
import lombok.extern.slf4j.Slf4j;
@ -31,7 +31,7 @@ public class ClassMetadataFactory {
public static FieldMetadata beginCreateFieldMetadata(Type type, String uuid) {
// 获取类型的枚举
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(type);
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(type);
// 设置响应结果
FieldMetadata fieldMetadata = null;

View File

@ -3,7 +3,6 @@ package cn.stylefeng.roses.kernel.scanner.api.util;
import cn.hutool.core.util.IdUtil;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
import cn.stylefeng.roses.kernel.rule.util.ClassTypeUtil;
import cn.stylefeng.roses.kernel.scanner.api.context.MetadataContext;
import cn.stylefeng.roses.kernel.scanner.api.enums.FieldMetadataTypeEnum;
import cn.stylefeng.roses.kernel.scanner.api.enums.ParamTypeEnum;
@ -58,7 +57,7 @@ public class FieldDescriptionUtil {
fieldMetadataItem.setGenericFieldMetadataType(FieldMetadataTypeEnum.FIELD.getCode());
}
// 设置字段类型基本、数组、还是object
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
fieldMetadataItem.setFieldType(classFieldType.getCode());
// 设置当前context构造的参数类型
ParamTypeEnum paramTypeMetadata = MetadataContext.getParamTypeMetadata(uuid);