groupscore.js 810 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 GroupscoreSchema = {
  6. classid: { type: String, required: true, maxLength: 200 }, // 班级id
  7. subid: { type: String, required: true, maxLength: 500 }, // 科目id
  8. date: { type: String, required: false, maxLength: 200 }, // 该科上课日期
  9. groupid: { type: String, required: true, maxLength: 200 }, // 小组id
  10. score: { type: String, required: true, maxLength: 200 }, // 分数
  11. };
  12. const schema = new Schema(GroupscoreSchema, { toJSON: { virtuals: true } });
  13. schema.index({ id: 1 });
  14. schema.plugin(metaPlugin);
  15. module.exports = app => {
  16. const { mongoose } = app;
  17. return mongoose.model('GroupscoreSchema', schema, 'groupscore');
  18. };