mirror of https://gitee.com/stylefeng/roses
【7.6.0】【scanner】修改调用新的扫描类
parent
2e154f6590
commit
31a6011f4b
|
@ -2,8 +2,8 @@ package cn.stylefeng.roses.kernel.scanner.api.context;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
|
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.enums.ParamTypeEnum;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.util.AdvancedClassTypeUtil;
|
||||||
|
|
||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
@ -75,7 +75,7 @@ public class MetadataContext {
|
||||||
Set<String> classRecords = META_DATA_CLASS_COUNT_CONTEXT.get(uuid);
|
Set<String> classRecords = META_DATA_CLASS_COUNT_CONTEXT.get(uuid);
|
||||||
if (classRecords != null) {
|
if (classRecords != null) {
|
||||||
// 获取字段类型,如果是数组,collection带实体的,需要获取真实的实体类型
|
// 获取字段类型,如果是数组,collection带实体的,需要获取真实的实体类型
|
||||||
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
|
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
|
||||||
|
|
||||||
// 如果是对象类型,直接判断
|
// 如果是对象类型,直接判断
|
||||||
if (classFieldType.equals(FieldTypeEnum.OBJECT)) {
|
if (classFieldType.equals(FieldTypeEnum.OBJECT)) {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package cn.stylefeng.roses.kernel.scanner.api.factory;
|
package cn.stylefeng.roses.kernel.scanner.api.factory;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
|
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.constants.ScannerConstants;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.context.MetadataContext;
|
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.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.ClassDescriptionUtil;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.util.FieldDescriptionUtil;
|
import cn.stylefeng.roses.kernel.scanner.api.util.FieldDescriptionUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -35,7 +35,7 @@ public class ClassDetailMetadataFactory {
|
||||||
public static Set<FieldMetadata> createFieldDetailMetadataSet(Type fieldType, String uuid) {
|
public static Set<FieldMetadata> createFieldDetailMetadataSet(Type fieldType, String uuid) {
|
||||||
|
|
||||||
// 获取参数的类型枚举
|
// 获取参数的类型枚举
|
||||||
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(fieldType);
|
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(fieldType);
|
||||||
|
|
||||||
// 设置响应结果
|
// 设置响应结果
|
||||||
Set<FieldMetadata> fieldMetadata = null;
|
Set<FieldMetadata> fieldMetadata = null;
|
||||||
|
@ -158,7 +158,7 @@ public class ClassDetailMetadataFactory {
|
||||||
|
|
||||||
// 如果是T这种形式,应该将当前fieldMetadata的类型改为泛型的类型,例如参数genericType是List时候
|
// 如果是T这种形式,应该将当前fieldMetadata的类型改为泛型的类型,例如参数genericType是List时候
|
||||||
if (FieldTypeEnum.WITH_UNKNOWN_GENERIC.getCode().equals(fieldMetadata.getFieldType())) {
|
if (FieldTypeEnum.WITH_UNKNOWN_GENERIC.getCode().equals(fieldMetadata.getFieldType())) {
|
||||||
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
|
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
|
||||||
fieldMetadata.setFieldType(classFieldType.getCode());
|
fieldMetadata.setFieldType(classFieldType.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package cn.stylefeng.roses.kernel.scanner.api.factory;
|
package cn.stylefeng.roses.kernel.scanner.api.factory;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
|
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.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.ClassDescriptionUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class ClassMetadataFactory {
|
||||||
public static FieldMetadata beginCreateFieldMetadata(Type type, String uuid) {
|
public static FieldMetadata beginCreateFieldMetadata(Type type, String uuid) {
|
||||||
|
|
||||||
// 获取类型的枚举
|
// 获取类型的枚举
|
||||||
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(type);
|
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(type);
|
||||||
|
|
||||||
// 设置响应结果
|
// 设置响应结果
|
||||||
FieldMetadata fieldMetadata = null;
|
FieldMetadata fieldMetadata = null;
|
||||||
|
|
|
@ -3,7 +3,6 @@ package cn.stylefeng.roses.kernel.scanner.api.util;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||||
import cn.stylefeng.roses.kernel.rule.enums.FieldTypeEnum;
|
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.context.MetadataContext;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.enums.FieldMetadataTypeEnum;
|
import cn.stylefeng.roses.kernel.scanner.api.enums.FieldMetadataTypeEnum;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.enums.ParamTypeEnum;
|
import cn.stylefeng.roses.kernel.scanner.api.enums.ParamTypeEnum;
|
||||||
|
@ -58,7 +57,7 @@ public class FieldDescriptionUtil {
|
||||||
fieldMetadataItem.setGenericFieldMetadataType(FieldMetadataTypeEnum.FIELD.getCode());
|
fieldMetadataItem.setGenericFieldMetadataType(FieldMetadataTypeEnum.FIELD.getCode());
|
||||||
}
|
}
|
||||||
// 设置字段类型,基本、数组、还是object
|
// 设置字段类型,基本、数组、还是object
|
||||||
FieldTypeEnum classFieldType = ClassTypeUtil.getClassFieldType(genericType);
|
FieldTypeEnum classFieldType = AdvancedClassTypeUtil.getClassFieldType(genericType);
|
||||||
fieldMetadataItem.setFieldType(classFieldType.getCode());
|
fieldMetadataItem.setFieldType(classFieldType.getCode());
|
||||||
// 设置当前context构造的参数类型
|
// 设置当前context构造的参数类型
|
||||||
ParamTypeEnum paramTypeMetadata = MetadataContext.getParamTypeMetadata(uuid);
|
ParamTypeEnum paramTypeMetadata = MetadataContext.getParamTypeMetadata(uuid);
|
||||||
|
|
Loading…
Reference in New Issue