123456789101112131415161718192021222324 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 文件导入表
- const DataimpSchema = {
- 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 }, // 状态
- errmsg: { type: String, required: false, maxLength: 200 }, // 导入错误信息
- };
- const schema = new Schema(DataimpSchema, { toJSON: { virtuals: true } });
- schema.index({ userid: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Dataimp', schema, 'data_imp');
- };
|