setting.js 1.4 KB

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