123456789101112131415161718192021222324 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 待办事项表
- const MessageSchema = {
- userid: { type: String, required: true, maxLength: 64 }, // 人员
- name: { type: String, required: false, maxLength: 200 }, // 名称
- createtime: { type: String, required: false, maxLength: 20 }, // 时间
- type: { type: String, required: false, maxLength: 64 }, // 类别
- content: { type: String, required: false, maxLength: 64 }, // 内容
- status: { type: String, required: false, maxLength: 2 }, // 状态
- remark: { type: String, maxLength: 128 }, // 备注
- };
- const schema = new Schema(MessageSchema, { toJSON: { virtuals: true } });
- schema.index({ userid: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Jobsmessage', schema, 'jobs_message');
- };
|