answerapply.js 728 B

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