You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
714 B

  1. "use strict";
  2. const Promise = require('bluebird'),
  3. _ = require('lodash');
  4. /**
  5. * Upload File schema
  6. *
  7. * @type {<Mongoose.Schema>}
  8. */
  9. var uplFileSchema = Mongoose.Schema({
  10. _id: String,
  11. category: {
  12. type: String,
  13. required: true,
  14. default: 'binary'
  15. },
  16. mime: {
  17. type: String,
  18. required: true,
  19. default: 'application/octet-stream'
  20. },
  21. extra: {
  22. type: Object
  23. },
  24. folder: {
  25. type: String,
  26. ref: 'UplFolder'
  27. },
  28. filename: {
  29. type: String,
  30. required: true
  31. },
  32. basename: {
  33. type: String,
  34. required: true
  35. },
  36. filesize: {
  37. type: Number,
  38. required: true
  39. }
  40. },
  41. {
  42. timestamps: {}
  43. });
  44. module.exports = Mongoose.model('UplFile', uplFileSchema);