12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 学生表
- const StudentSchema = {
- name: { type: String, required: true, maxLength: 200, zh: '姓名' }, // 姓名
- id_number: { type: String, required: true, maxLength: 200, zh: '身份证号' }, // 身份证号
- phone: { type: String, required: true, maxLength: 200, zh: '手机号' }, // 手机号
- gender: { type: String, required: false, maxLength: 200, zh: '性别' }, // 性别
- nation: { type: String, required: false, maxLength: 200, zh: '民族' }, // 民族
- school_name: { type: String, required: false, maxLength: 200, zh: '学校名称' }, // 学校名称
- schid: { type: String, required: false, maxLength: 200, zh: '学校id' }, // 学校id
- faculty: { type: String, required: false, maxLength: 200, zh: '院系' }, // 院系
- major: { type: String, required: false, maxLength: 200, zh: '专业' }, // 专业
- edua_level: { type: String, required: false, maxLength: 200, zh: '学历层次' }, // 学历层次
- edua_system: { type: String, required: false, maxLength: 200, zh: '学制' }, // 学制
- entry_year: { type: String, required: false, maxLength: 200, zh: '入学年份' }, // 入学年份
- finish_year: { type: String, required: false, maxLength: 200, zh: '毕业年份' }, // 毕业年份
- school_job: { type: String, required: false, maxLength: 200, zh: '在校担任何种职务' }, // 在校担任何种职务
- qq: { type: String, required: false, maxLength: 200, zh: 'QQ号' }, // QQ号
- email: { type: String, required: false, maxLength: 200, zh: '邮箱' }, // 邮箱
- openid: { type: String, required: false, maxLength: 200, zh: '微信openid' }, // 微信openid
- family_place: { type: String, required: false, maxLength: 200, zh: '家庭所在地' }, // 家庭所在地
- family_is_hard: { type: String, required: false, maxLength: 200, zh: '家庭是否困难' }, // 家庭是否困难,0-否,1-是
- have_grant: { type: String, required: false, maxLength: 200, zh: '是否获得过助学金' }, // 是否获得过助学金,0-否,1-是
- job: { type: String, required: false, maxLength: 200, default: '普通学生', zh: '职务' }, // 职务
- planyearid: { type: String, required: false, maxLength: 200, zh: '大批次id' }, // 大批次id
- planid: { type: String, required: false, maxLength: 200, zh: '计划id' }, // 计划id
- termid: { type: String, required: false, maxLength: 200, zh: '期id' }, // 期id
- batchid: { type: String, required: false, maxLength: 200, zh: '批次id' }, // 批次id
- classid: { type: String, required: false, maxLength: 200, zh: '班级id' }, // 班级id
- bedroomid: { type: String, required: false, maxLength: 200, zh: '寝室id' }, // 寝室id
- bedroom: { type: String, required: false, maxLength: 200, zh: '寝室号' }, // 寝室号
- is_fine: { type: String, required: false, maxLength: 200, default: '0', zh: '是否优秀' }, // 是否优秀,0-否,1-是,2-无资格
- selfscore: { type: String, required: false, maxLength: 200, zh: '个人分' }, // 个人分
- score: { type: String, required: false, maxLength: 200, zh: '总分' }, // 总分
- diy: { type: { Object }, required: false, zh: '自定义' }, // 自定义
- isComming: { type: String, default: '0', zh: '签到' }, // 是否签到0否,1是
- type: { type: String, required: false, maxLength: 200, default: '0' }, // 类型:0-正常,1-特殊
- status: { type: String, required: false, maxLength: 200, default: '1' }, // 0:待确定。1:确定,2:失败
- };
- const schema = new Schema(StudentSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Student', schema, 'student');
- };
|