'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 设置表 const SettingSchema = { planyearid: { type: String, required: false, maxLength: 100 }, // 默认大批次id planid: { type: String, required: false, maxLength: 100 }, // 默认年度计划id termid: { type: String, required: false, maxLength: 100 }, // 默认期id user_email: { type: String, required: false, maxLength: 100 }, // 服务器邮箱 auth_code: { type: String, required: false, maxLength: 100 }, // 服务器邮箱授权码 am_start: { type: String, required: false, maxLength: 20 }, // 上午考勤开始时间 am_end: { type: String, required: false, maxLength: 20 }, // 上午考勤结束时间 pm_start: { type: String, required: false, maxLength: 20 }, // 下午开始时间 pm_end: { type: String, required: false, maxLength: 20 }, // 下午结束时间 bd_start: { type: String, required: false, maxLength: 20 }, // 寝室开始时间 bd_end: { type: String, required: false, maxLength: 20 }, // 寝室结束时间 ques_setting: { type: [ Object ], required: false, maxLength: 1000 }, // 问卷设置默认导出字段 }; const schema = new Schema(SettingSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Setting', schema, 'setting'); };