mirror of https://github.com/requarks/wiki
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.
51 lines
737 B
51 lines
737 B
"use strict";
|
|
|
|
const modb = require('mongoose'),
|
|
Promise = require('bluebird'),
|
|
_ = require('lodash');
|
|
|
|
/**
|
|
* Upload File schema
|
|
*
|
|
* @type {<Mongoose.Schema>}
|
|
*/
|
|
var uplFileSchema = modb.Schema({
|
|
|
|
_id: String,
|
|
|
|
category: {
|
|
type: String,
|
|
required: true,
|
|
default: 'binary'
|
|
},
|
|
mime: {
|
|
type: String,
|
|
required: true,
|
|
default: 'application/octet-stream'
|
|
},
|
|
extra: {
|
|
type: Object
|
|
},
|
|
folder: {
|
|
type: String,
|
|
ref: 'UplFolder'
|
|
},
|
|
filename: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
basename: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
filesize: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
|
|
},
|
|
{
|
|
timestamps: {}
|
|
});
|
|
|
|
module.exports = modb.model('UplFile', uplFileSchema); |