Skip to content
Permalink
Browse files
add: private field过滤..
  • Loading branch information
creasy2010 committed Jun 29, 2018
1 parent 0ec4c10 commit 5d998c213f52a5ccdf7a1e3ca28230b2cbf98bef
Showing 5 changed files with 10 additions and 9 deletions.
Binary file not shown.
@@ -30,7 +30,7 @@ export async function extra(extraParam: IDubboExtInfo): Promise<IExtraResult> {
return new Promise<IExtraResult>((resolve, reject) => {
let execCmd = spawn(`java`, [
'-jar',
join(__dirname, '../../ext/jexpose-1.1.jar'),
join(__dirname, '../../ext/jexpose-1.2.jar'),
extraParam.entry,
extraParam.entryJarPath,
extraParam.libDirPath,
@@ -311,8 +311,6 @@ export function j2Jtj(
classPath.lastIndexOf('.') + 1,
)}(${paramRefName})`;
} else {
throw new Error(
`生成js-to-java代码出错:${paramRefName},${classPath}, ${classPath}`,
);
return `${paramRefName}`
}
}
@@ -27,8 +27,8 @@ export interface IDubboExtInfo {
entryJarPath: string;
//指定jar包依赖的包目录
libDirPath: string;
//provider后缀名可配置
providerSuffix: string;
//provider后缀名可配置,默认值 Provider
providerSuffix?: string;
}

export interface IConfig extends IDubboExtInfo {
@@ -91,7 +91,7 @@ export async function jType2Ts(
typePropers.name === 'java.util.Map' &&
typePropers.typeArgs.length === 0
) {
return '{[name: any]: any}';
return 'any';//直接返回any
} else if (typePropers.typeArgs && typePropers.typeArgs.length > 0) {
//泛型处理
let type = await classPath2TypeName(typePropers.name, typeOptions);
@@ -113,6 +113,8 @@ export async function jType2Ts(
result = type
.replace('${nameType}', nameType)
.replace('${value}', valueType);
} else if(type === 'any') {
return 'any';
} else {
let subTypes = [];
for (var i = 0, iLen = typePropers.typeArgs.length; i < iLen; i++) {
@@ -160,9 +162,10 @@ export async function classPath2TypeName(
return denpendItem.importName;
}else{
console.warn('warning: not find class Type for :'+classPath);
return "";
return "any";
}
} else {
throw new Error(`未找到类${classPath},在typescript中的信息; `);
return "any";
// throw new Error(`未找到类${classPath},在typescript中的信息; `);
}
}

0 comments on commit 5d998c2

Please sign in to comment.