lrf преди 2 години
родител
ревизия
88c143da56
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      app/public/ts-template.js

+ 3 - 3
app/public/ts-template.js

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