#ifndef USER_H #define USER_H #include "core-data.h" #include "../core_global.h" #include #include #include #include #include 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 > listRoles() const; void setListRoles(const QList > &listRoles); void addRole(QSharedPointer 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 > m_listRoles; }; QX_REGISTER_HPP_CORE(User, QObject, 0) #endif // USER_H