|
@@ -76,7 +76,7 @@ function isInteger(num) {
|
|
|
|
|
|
function inferJavaType(value) {
|
|
function inferJavaType(value) {
|
|
if (value === null || value === undefined) return 'String';
|
|
if (value === null || value === undefined) return 'String';
|
|
- if (typeof value === 'number') return isInteger(value) ? 'Integer' : 'Double';
|
|
|
|
|
|
+ if (typeof value === 'number') return isInteger(value) ? 'Integer' : 'BigDecimal';
|
|
if (typeof value === 'boolean') return 'Boolean';
|
|
if (typeof value === 'boolean') return 'Boolean';
|
|
if (typeof value === 'string') return 'String';
|
|
if (typeof value === 'string') return 'String';
|
|
if (Array.isArray(value)) {
|
|
if (Array.isArray(value)) {
|
|
@@ -175,6 +175,11 @@ function generateJavaClass(pkg, className, fieldsOrder, fieldTypes, fieldComment
|
|
usedTypes.add('java.util.List');
|
|
usedTypes.add('java.util.List');
|
|
} else if (type === 'List<Object>') {
|
|
} else if (type === 'List<Object>') {
|
|
usedTypes.add('java.util.List');
|
|
usedTypes.add('java.util.List');
|
|
|
|
+ } else if (type === 'List<BigDecimal>') {
|
|
|
|
+ usedTypes.add('java.util.List');
|
|
|
|
+ usedTypes.add('java.math.BigDecimal');
|
|
|
|
+ } else if (type === 'BigDecimal') {
|
|
|
|
+ usedTypes.add('java.math.BigDecimal');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -197,7 +202,7 @@ function generateJavaClass(pkg, className, fieldsOrder, fieldTypes, fieldComment
|
|
|
|
|
|
// Add path field using the actual JSON filename
|
|
// Add path field using the actual JSON filename
|
|
lines.push('\t/** JSON 配置文件路径 */');
|
|
lines.push('\t/** JSON 配置文件路径 */');
|
|
- lines.push('\tpublic static final String path = "table/' + jsonFileName + '";');
|
|
|
|
|
|
+ lines.push('\tpublic static final String path = "' + jsonFileName + '";');
|
|
lines.push('');
|
|
lines.push('');
|
|
|
|
|
|
// Add fields
|
|
// Add fields
|