experience.js 761 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 职责说明表
  5. const ExperienceSchema = {
  6. termid: { type: String, required: false }, // 班级id
  7. batchid: { type: String, required: false }, // 班级id
  8. classid: { type: String, ref: 'Class' }, // 班级id
  9. studentid: { type: String, ref: 'Student' }, // 学生id
  10. title: { type: String }, // 培训心得标题
  11. content: { type: String }, // 培训心得内容
  12. };
  13. const schema = new Schema(ExperienceSchema, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Experience', schema, 'experience');
  19. };