#ifndef NOTICEOBJECT_H
#define NOTICEOBJECT_H

#include <QObject>
#include <QJsonObject>
#include <QVariant>
#include <QMetaProperty>

class NoticeObject : public QObject
{
    Q_OBJECT
    Q_PROPERTY (int id READ getId WRITE setId)
    Q_PROPERTY (QString title READ getTitle WRITE setTitle)
    Q_PROPERTY (QString content READ getContent WRITE setContent)
    Q_PROPERTY (int ackStatus READ getAckStatus WRITE setAckStatus)
    Q_PROPERTY (QString createDatetime READ getCreateDatetime WRITE setCreateDatetime)

public:
    explicit NoticeObject(QObject *parent = 0):QObject(parent){}
    NoticeObject(const NoticeObject& noticeObj,QObject* parent=0);
    NoticeObject& operator =(const NoticeObject& noticeObj);
    void FetchDataFromJson(const QJsonObject &json);
    int id;
    QString title;
    QString content;
    QString createDatetime;
    int ackStatus;

protected:

    inline int getId(){ return id; }
    inline void setId(const int& v){ id = v; }

    inline QString getTitle(){ return title; }
    inline void setTitle(const QString& v){ title = v; }

    inline QString getContent(){ return content; }
    inline void setContent(const QString& v){ content = v; }

    inline int getAckStatus(){ return ackStatus; }
    inline void setAckStatus(const int& v){ ackStatus = v; }

    inline QString getCreateDatetime(){ return createDatetime; }
    inline void setCreateDatetime(const QString& v){ createDatetime = v; }

};

#endif // NOTICEOBJECT_H
