Resource.js 367 B

1234567891011121314151617181920
  1. 'use strict';
  2. module.exports = app => {
  3. const { mongoose } = app;
  4. const { Schema } = mongoose;
  5. const ResourceSchema = new Schema({
  6. // 文件名
  7. name: {
  8. type: String,
  9. },
  10. // 文件路径
  11. path: {
  12. type: String,
  13. },
  14. // 数据id
  15. id: {
  16. type: String,
  17. },
  18. });
  19. return mongoose.model('Resource', ResourceSchema);
  20. };