duty.js 565 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 职责说明表
  5. const DutySchema = {
  6. bzduty: { type: String, required: false, maxLength: 2000 }, // 班长职责
  7. xwduty: { type: String, required: false, maxLength: 2000 }, // 学委职责
  8. };
  9. const schema = new Schema(DutySchema, { toJSON: { virtuals: true } });
  10. schema.index({ id: 1 });
  11. schema.plugin(metaPlugin);
  12. module.exports = app => {
  13. const { mongoose } = app;
  14. return mongoose.model('Duty', schema, 'duty');
  15. };