Skip to content
Permalink
Browse files
del : 删除无用判断 ..
  • Loading branch information
creasy2010 committed Jun 28, 2018
1 parent 96155da commit 7a60a78c4f96b39f331db7d90969b2ad33f88727
Showing 4 changed files with 218 additions and 14 deletions.

Some generated files are not rendered by default. Learn more.

@@ -63,13 +63,6 @@ export async function toBeanClass(
filedType = typeDef.fields[fieldName].elementType.name;
}

if (
filedType.startsWith('com.qianmi') ||
filedType.startsWith('java.lang') ||
filedType.startsWith('java.util') ||
filedType.startsWith('java.math') ||
intepretHandle.isTypeParam(filedType)
) {
let field = await toField(
fieldName,
typeDef.fields[fieldName],
@@ -84,7 +77,6 @@ export async function toBeanClass(
type: await jType2Ts(filedItem, intepretHandle),
filedAst: filedItem,
});
}
}
//添加构造函数入参interface
//1.2 生成方法;;
@@ -294,7 +294,8 @@ export function j2Jtj(
//引入类并且不是枚举类型
return `${paramRefName}?${paramRefName}.__fields2java():null`;
} else {
throw new Error('不可能出现这种的,classPathStr:' + classPath + isClass);
return `${paramRefName}['__fields2java']?${paramRefName}['__fields2java']():${paramRefName}`;
// throw new Error('不可能出现这种的,classPathStr:' + classPath + isClass);
}
} else if (typeOptions.isTypeParam(classPath)) {
return `${paramRefName}['__fields2java']?${paramRefName}['__fields2java']():${paramRefName}`;
@@ -37,14 +37,9 @@ export async function toInterface(
let properties: PropertySignatureStructure[] = [];

for (let fieldName in typeDef.fields) {
if (
typeDef.fields[fieldName].name.startsWith('com.qianmi') ||
typeDef.fields[fieldName].name.startsWith('java.')
) {
properties.push(
await toField(fieldName, typeDef.fields[fieldName], intepretHandle),
);
}
}

let filtersMethodNames = genePropsGetSet(properties.map(({name}) => name));

0 comments on commit 7a60a78

Please sign in to comment.