mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
34 lines
821 B
JavaScript
34 lines
821 B
JavaScript
"use strict";
|
|
|
|
const dateUtils = require('../../services/date_utils');
|
|
const AbstractEntity = require("./abstract_entity");
|
|
|
|
/**
|
|
* RecentNote represents recently visited note.
|
|
*/
|
|
class RecentNote extends AbstractEntity {
|
|
static get entityName() { return "recent_notes"; }
|
|
static get primaryKeyName() { return "noteId"; }
|
|
|
|
constructor(row) {
|
|
super();
|
|
|
|
/** @type {string} */
|
|
this.noteId = row.noteId;
|
|
/** @type {string} */
|
|
this.notePath = row.notePath;
|
|
/** @type {string} */
|
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
|
}
|
|
|
|
getPojo() {
|
|
return {
|
|
noteId: this.noteId,
|
|
notePath: this.notePath,
|
|
utcDateCreated: this.utcDateCreated
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = RecentNote;
|