personalscore.js 818 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 PersonalscoreSchema = {
  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. studentid: { type: String, required: true, maxLength: 200 }, // 学生id
  10. score: { type: String, required: true, maxLength: 200 }, // 分数
  11. };
  12. const schema = new Schema(PersonalscoreSchema, { toJSON: { virtuals: true } });
  13. schema.index({ id: 1 });
  14. schema.plugin(metaPlugin);
  15. module.exports = app => {
  16. const { mongoose } = app;
  17. return mongoose.model('Personalscore', schema, 'personalscore');
  18. };