You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.8 KiB
C

#ifndef USER_H
#define USER_H
#include "core-data.h"
#include "../core_global.h"
#include <QObject>
#include <QString>
#include <QSharedPointer>
#include <QList>
#include <QDateTime>
class CORESHARED_EXPORT User : public QObject
{
Q_OBJECT
QX_REGISTER_FRIEND_CLASS(User)
Q_PROPERTY(QString login READ login WRITE setLogin)
Q_PROPERTY(QString password READ password WRITE setPassword)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(bool active READ active WRITE setActive)
Q_PROPERTY(bool isAdmin READ isAdmin WRITE setIsAdmin)
Q_PROPERTY(QDateTime lastModDate READ lastModDate WRITE setLastModDate)
Q_PROPERTY(QDateTime createDate READ createDate WRITE setCreateDate)
public:
User() = default;
long id() const;
void setId(long id);
QString login() const;
void setLogin(const QString &login);
QString password() const;
void setPassword(const QString &password);
QString name() const;
void setName(const QString &name);
QDateTime lastModDate() const;
void setLastModDate(const QDateTime &lastModDate);
QDateTime createDate() const;
void setCreateDate(const QDateTime &createDate);
bool active() const;
void setActive(bool active);
bool isAdmin() const;
void setIsAdmin(bool isAdmin);
QList<QSharedPointer<Role> > listRoles() const;
void setListRoles(const QList<QSharedPointer<Role> > &listRoles);
void addRole(QSharedPointer<Role> role);
void clearRoles();
Q_INVOKABLE QStringList eagerLoad();
private:
long m_id;
QString m_login;
QString m_password;
QString m_name;
QDateTime m_lastModDate;
QDateTime m_createDate;
bool m_active;
bool m_isAdmin;
QList<QSharedPointer<Role> > m_listRoles;
};
QX_REGISTER_HPP_CORE(User, QObject, 0)
#endif // USER_H