|
@@ -1,8 +1,8 @@
|
|
const _ = require('lodash');
|
|
const _ = require('lodash');
|
|
-const getModelType = (type, interface = false) => {
|
|
|
|
|
|
+const getModelType = (type, interf = false) => {
|
|
let modelType = 'string';
|
|
let modelType = 'string';
|
|
if (type === 'Money' || type === 'money') {
|
|
if (type === 'Money' || type === 'money') {
|
|
- if (!interface) modelType = 'Decimal128';
|
|
|
|
|
|
+ if (!interf) modelType = 'Decimal128';
|
|
else modelType = 'number';
|
|
else modelType = 'number';
|
|
} else if (type === 'ObjectId') modelType = 'ObjectId';
|
|
} else if (type === 'ObjectId') modelType = 'ObjectId';
|
|
else if (type === 'Array') modelType = 'Array';
|
|
else if (type === 'Array') modelType = 'Array';
|
|
@@ -132,7 +132,7 @@ const ControllerContext = (data) => {
|
|
const getInterfaceColumn = (col, needReq = false) => {
|
|
const getInterfaceColumn = (col, needReq = false) => {
|
|
const fc = [];
|
|
const fc = [];
|
|
const { type, zh, title, required } = col;
|
|
const { type, zh, title, required } = col;
|
|
- const modelType = getModelType(type);
|
|
|
|
|
|
+ const modelType = getModelType(type, true);
|
|
fc.push(` @ApiProperty({ description: '${title}' })`);
|
|
fc.push(` @ApiProperty({ description: '${title}' })`);
|
|
if (needReq) {
|
|
if (needReq) {
|
|
let ruleStr = '';
|
|
let ruleStr = '';
|