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.

50 lines
737 B

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