2024-02-17 01:06:07 +02:00
|
|
|
import { BlobRow } from "./rows";
|
|
|
|
|
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"]; }
|
|
|
|
|
2024-02-17 01:06:07 +02:00
|
|
|
blobId: string;
|
|
|
|
content: string | Buffer;
|
|
|
|
contentLength: number;
|
|
|
|
dateModified: string;
|
|
|
|
utcDateModified: string;
|
|
|
|
|
|
|
|
constructor(row: BlobRow) {
|
2023-05-05 16:37:39 +02:00
|
|
|
this.blobId = row.blobId;
|
|
|
|
this.content = row.content;
|
|
|
|
this.contentLength = row.contentLength;
|
|
|
|
this.dateModified = row.dateModified;
|
|
|
|
this.utcDateModified = row.utcDateModified;
|
|
|
|
}
|
|
|
|
|
|
|
|
getPojo() {
|
|
|
|
return {
|
|
|
|
blobId: this.blobId,
|
|
|
|
content: this.content,
|
|
|
|
contentLength: this.contentLength,
|
|
|
|
dateModified: this.dateModified,
|
|
|
|
utcDateModified: this.utcDateModified
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-17 01:06:07 +02:00
|
|
|
export = BBlob;
|