This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ProgBlog/app/models/User.js

24 lines
387 B
JavaScript

'use strict';
const container = require('../Container');
const Config = container.get('Config');
const DBModel = container.getBase('DBModel');
class UserModel extends DBModel {
constructor() {
super();
}
getAll() {
return this.db.get('users');
}
getUserById(userId) {
return this.db.from('users')
.where('id', userId)
.get();
}
}
module.exports = new UserModel();