answerapply.js 799 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const Answerapply = {
  5. teacher: { type: String, required: true, maxLength: 200 }, // 教师
  6. teacherid: { type: String, required: true, maxLength: 200 }, // 教师id
  7. date: { type: [ String ], required: true }, // 申请答疑的时间列表
  8. subid: { type: String, required: true, maxLength: 200 }, // 科目id
  9. status: { type: String, maxLength: 200, default: '0' }, // 状态:0=>未审核;1=>通过;2=>拒绝
  10. };
  11. const schema = new Schema(Answerapply, { toJSON: { virtuals: true } });
  12. schema.index({ id: 1 });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('Answerapply', schema, 'answerapply');
  17. };