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.
CoreID/app/models/system/Announcement.model.js

27 lines
613 B

const { Model } = require('flitter-orm')
class AnnouncementModel extends Model {
static get schema() {
return {
title: String,
message: String,
user_ids: [String],
group_ids: [String],
type: String, // login | email | banner
}
}
async to_api() {
return {
id: this.id,
title: this.title,
message: this.message,
user_ids: this.user_ids,
group_ids: this.group_ids,
type: this.type,
}
}
}
module.exports = exports = AnnouncementModel