Bladeren bron

新增字段carpnum

reloaded 5 jaren geleden
bovenliggende
commit
96e0a45c94
2 gewijzigde bestanden met toevoegingen van 20 en 2 verwijderingen
  1. 19 2
      app/controller/.trainmodel.js
  2. 1 0
      app/model/trainmodel.js

+ 19 - 2
app/controller/.trainmodel.js

@@ -1,6 +1,14 @@
 module.exports = {
   create: {
-    requestBody: ["total", "day", "color", "batchnum", "classnum", "stunum"],
+    requestBody: [
+      "total",
+      "day",
+      "color",
+      "batchnum",
+      "classnum",
+      "stunum",
+      "carpnum",
+    ],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +16,15 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["total", "day", "color", "batchnum", "classnum", "stunum"],
+    requestBody: [
+      "total",
+      "day",
+      "color",
+      "batchnum",
+      "classnum",
+      "stunum",
+      "carpnum",
+    ],
   },
   show: {
     parameters: {
@@ -25,6 +41,7 @@ module.exports = {
         batchnum: "batchnum",
         classnum: "classnum",
         stunum: "stunum",
+        carpnum: "carpnum",
       },
     },
     service: "query",

+ 1 - 0
app/model/trainmodel.js

@@ -10,6 +10,7 @@ const TrainmodelSchema = {
   batchnum: { type: String, required: false, maxLength: 200 }, // 默认期下生成的批次数
   classnum: { type: String, required: false, maxLength: 200 }, // 默认批次下生成的班级数
   stunum: { type: String, required: false, maxLength: 200 }, // 默认每班学生数
+  carpnum: { type: String, required: false, maxLength: 200 }, // 默认每辆车的学生数
 };