harmadik gyakorlat
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Domain model - User
|
||||
* Ez a User entitás domain reprezentációja
|
||||
*/
|
||||
export class User {
|
||||
constructor(data) {
|
||||
this.id = data.id;
|
||||
this.email = data.email;
|
||||
this.username = data.username;
|
||||
this.password = data.password;
|
||||
this.role = data.role;
|
||||
this.createdAt = data.createdAt;
|
||||
this.updatedAt = data.updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* User DTO publikus adatokkal (jelszó nélkül)
|
||||
*/
|
||||
toPublicObject() {
|
||||
return {
|
||||
id: this.id,
|
||||
email: this.email,
|
||||
username: this.username,
|
||||
role: this.role,
|
||||
createdAt: this.createdAt,
|
||||
updatedAt: this.updatedAt
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user