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.
26 lines
586 B
26 lines
586 B
const {query} = require("../client")
|
|
|
|
class Post {
|
|
/**
|
|
* @param {string} id
|
|
* @param {number} position
|
|
* @param {Date | string | number} time
|
|
* @param {string} kind
|
|
* @param {string} nick
|
|
* @param {string} text
|
|
*/
|
|
constructor(id, position, time, kind, nick, text) {
|
|
this.id = id
|
|
this.position = position
|
|
this.time = new Date(time)
|
|
this.kind = kind
|
|
this.nick = nick
|
|
this.text = text
|
|
}
|
|
|
|
static fromData(data) {
|
|
return new Post(data.id, data.position, data.time, data.kind, data.nick, data.text)
|
|
}
|
|
}
|
|
|
|
module.exports = {Post}
|