experience.js 818 B

1234567891011121314151617181920212223
  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. planid: { type: String, required: false }, // 计划id
  7. termid: { type: String, required: false }, // 班级id
  8. batchid: { type: String, required: false }, // 班级id
  9. classid: { type: String, ref: 'Class' }, // 班级id
  10. studentid: { type: String, ref: 'Student' }, // 学生id
  11. title: { type: String }, // 培训心得标题
  12. content: { type: String }, // 培训心得内容
  13. };
  14. const schema = new Schema(ExperienceSchema, { toJSON: { virtuals: true } });
  15. schema.index({ id: 1 });
  16. schema.plugin(metaPlugin);
  17. module.exports = app => {
  18. const { mongoose } = app;
  19. return mongoose.model('Experience', schema, 'experience');
  20. };