1234567891011121314151617181920212223242526 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 班主任表
- const HeadteacherSchema = {
- name: { type: String, required: true, maxLength: 200 }, // 姓名
- phone: { type: String, required: true, maxLength: 200 }, // 手机号
- gender: { type: String, required: false, maxLength: 200 }, // 教师性别
- openid: { type: String, required: false, maxLength: 200 }, // 微信openid
- age: { type: String, required: false, maxLength: 200 }, // 年龄
- birthday: { type: String, required: false, maxLength: 200 }, // 出生年月
- department: { type: String, required: false, maxLength: 200 }, // 所在部门
- islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
- };
- const schema = new Schema(HeadteacherSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Headteacher', schema, 'headteacher');
- };
|