toconfig.js 408 B

12345678910111213
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const SchemaDefine = {
  4. code: { type: String, required: true },
  5. name: { type: String, required: true },
  6. value: { type: String, required: true },
  7. type: { type: String, required: false },
  8. };
  9. const schema = new Schema(SchemaDefine);
  10. module.exports = app => {
  11. const { mongoose } = app;
  12. return mongoose.model('toconfig', schema, 'toconfig');
  13. };