1234567891011121314151617181920212223242526272829303132333435363738 |
- '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 },
- gender: { type: String, required: false, maxLength: 200 },
- department: { type: String, required: false, maxLength: 200 },
- mobile: { type: String, required: true, maxLength: 200 },
- nation: { type: String, required: false, maxLength: 200 },
- phone: { type: String, required: false, maxLength: 200 },
- idnumber: { type: String, required: false, maxLength: 18 },
- politics: { type: String, required: false, maxLength: 18 },
- jobaddress: { type: String, required: false, maxLength: 18 },
- job: { type: String, required: false, maxLength: 200 },
- protitle: { type: String, required: false, maxLength: 200 },
- education: { type: String, required: false, maxLength: 200 },
- degree: { type: String, required: false, maxLength: 200 },
- qq: { type: String, required: false, maxLength: 200 },
- age: { type: String, required: false, maxLength: 200 },
- eduexperience: { type: [ Object ], required: false, maxLength: 200 },
- islyteacher: { type: String, required: false, maxLength: 200 },
- openid: { type: String, required: false, maxLength: 200 },
- status: { type: String, required: false, maxLength: 200, default: '0' },
-
- };
- 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');
- };
|