Explorar o código

增加默认值

liuyu %!s(int64=5) %!d(string=hai) anos
pai
achega
25193736f3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/model/trainplan.js

+ 1 - 1
app/model/trainplan.js

@@ -40,7 +40,7 @@ const festivalInfo = new Schema({
 const TrainplanSchema = {
   year: { type: String, required: true, maxLength: 200 }, // 年份
   title: { type: String, required: true, maxLength: 500 }, // 标题
-  status: { type: String, required: false, maxLength: 200 }, // 状态,0-筹备中,1-发布,2-结束
+  status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态,0-筹备中,1-发布,2-结束
   termnum: { type: [ termInfo ], select: true }, // 期
   festivals: { type: [ festivalInfo ], select: true }, // 节假日
 };