role.js 314 B

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