Move project in sub

This commit is contained in:
Andrew nuark G 2020-12-18 17:40:22 +07:00
parent f868166756
commit ec1af1b8e5
43 changed files with 358 additions and 2 deletions

View file

@ -1,29 +0,0 @@
#include "user_entity.h"
user_entity::user_entity(const QString &login, const QString &password, UserRole role) : _login(login), _role(role) {
this->_pwd_hash = QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha3_256);
}
entity_id user_entity::id() {
return this->_id;
}
const QString user_entity::login() {
return this->_login;
}
UserRole user_entity::role() {
return this->_role;
}
bool user_entity::verify_password(const QString &password) {
return (this->_pwd_hash == QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha3_256));
}
void user_entity::serialize(QDataStream &output) {
output << this->_id << this->_login << this->_role << this->_pwd_hash;
}
void user_entity::deserialize(QDataStream &input) {
input >> this->_id >> this->_login >> this->_role >> this->_pwd_hash;
}