Notes/src/becca/entities/bblob.js

31 lines
871 B
JavaScript
Raw Normal View History

2023-05-05 16:37:39 +02:00
class BBlob {
2023-06-28 21:05:31 +02:00
static get entityName() { return "blobs"; }
static get primaryKeyName() { return "blobId"; }
static get hashedProperties() { return ["blobId", "content"]; }
2023-05-05 16:37:39 +02:00
constructor(row) {
/** @type {string} */
this.blobId = row.blobId;
/** @type {string|Buffer} */
this.content = row.content;
2023-06-29 23:32:19 +02:00
/** @type {int} */
2023-05-05 16:37:39 +02:00
this.contentLength = row.contentLength;
/** @type {string} */
this.dateModified = row.dateModified;
/** @type {string} */
this.utcDateModified = row.utcDateModified;
}
getPojo() {
return {
blobId: this.blobId,
content: this.content,
contentLength: this.contentLength,
dateModified: this.dateModified,
utcDateModified: this.utcDateModified
};
}
}
module.exports = BBlob;