routes on files
This commit is contained in:
+33
-15
@@ -1,20 +1,38 @@
|
||||
class User {
|
||||
constructor(json){
|
||||
this.username = 'aeroreyna';
|
||||
this.following = [];
|
||||
this.lastUpdate = new Date();
|
||||
this.newsFeedCache = [];
|
||||
this.isGroup = false;
|
||||
constructor(info){
|
||||
if(!info || !info.userid) throw "Can not construct empty profile";
|
||||
this.userid = info.userid;
|
||||
this.profile = {
|
||||
firstName: info.profile && info.profile.firstName || '',
|
||||
lastName: info.profile && info.profile.lastName || '',
|
||||
photo: info.profile && info.profile.photo || '',
|
||||
location: info.profile && info.profile.location || '',
|
||||
language: info.profile && info.profile.language || '',
|
||||
status: info.profile && info.profile.status || '',
|
||||
description: info.profile && info.profile.description || '',
|
||||
};
|
||||
this.data = info.data || {};
|
||||
this.username = info.username || '';
|
||||
this.following = info.following || [];
|
||||
this.lastUpdate = info.lastUpdate || new Date();
|
||||
this.newsFeedCache = info.newsFeedCache || [];
|
||||
this.isGroup = info.isGroup || false;
|
||||
}
|
||||
|
||||
newPost(content){
|
||||
|
||||
}
|
||||
newComment(post){
|
||||
|
||||
}
|
||||
newReaction(){
|
||||
|
||||
toObj(){
|
||||
let r = {};
|
||||
r.userid = this.userid
|
||||
r.username = this.username;
|
||||
r.profile = this.profile;
|
||||
r.data = this.data;
|
||||
r.username = this.username;
|
||||
r.following = this.following;
|
||||
r.lastUpdate = this.lastUpdate;
|
||||
r.newsFeedCache = this.newsFeedCache;
|
||||
r.isGroup = this.isGroup;
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = User;
|
||||
Reference in New Issue
Block a user