Role.js 497 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. module.exports = app => {
  3. const { mongoose } = app;
  4. const { Schema } = mongoose;
  5. const RoleSchema = new Schema({
  6. // 角色名
  7. name: {
  8. type: String,
  9. },
  10. // 角色编码
  11. code: {
  12. type: String,
  13. },
  14. // 角色id
  15. id: {
  16. type: String,
  17. },
  18. // 角色状态
  19. state: {
  20. type: String,
  21. },
  22. // 角色绑定系统菜单组
  23. adminMenuList: {
  24. type: Array,
  25. },
  26. });
  27. return mongoose.model('Role', RoleSchema);
  28. };