imgtype.js 320 B

1234567891011
  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. };
  7. const schema = new Schema(SchemaDefine);
  8. module.exports = app => {
  9. const { mongoose } = app;
  10. return mongoose.model('imgtype', schema, 'imgtype');
  11. };