Move project in sub
This commit is contained in:
parent
f868166756
commit
ec1af1b8e5
43 changed files with 358 additions and 2 deletions
35
sea_transport/entities/user_entity.h
Normal file
35
sea_transport/entities/user_entity.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef USER_ENTITY_H
|
||||
#define USER_ENTITY_H
|
||||
|
||||
#include "IEntity.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QCryptographicHash>
|
||||
|
||||
|
||||
enum class UserRole {
|
||||
ADMINISTRATOR, DISPATCHER, SKIPPER
|
||||
};
|
||||
|
||||
|
||||
class user_entity : public IEntity {
|
||||
private:
|
||||
entity_id _id;
|
||||
QString _login;
|
||||
UserRole _role;
|
||||
QByteArray _pwd_hash;
|
||||
|
||||
public:
|
||||
user_entity() = default;
|
||||
user_entity(const QString &login, const QString &password, UserRole role);
|
||||
|
||||
entity_id id();
|
||||
const QString login();
|
||||
UserRole role();
|
||||
bool verify_password(const QString &password) const;
|
||||
|
||||
void serialize(QDataStream &output);
|
||||
void deserialize(QDataStream &input);
|
||||
};
|
||||
|
||||
#endif // USER_ENTITY_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue