Nut/test/common/post.h

42 lines
723 B
C
Raw Normal View History

2016-05-12 14:08:58 +08:00
#ifndef USER_H
#define USER_H
#include <QtCore/qglobal.h>
#include "table.h"
#include "database.h"
#include "comment.h"
#include "databasemodel.h"
2017-02-01 18:01:21 +08:00
#ifdef NUT_NAMESPACE
using namespace NUT_NAMESPACE;
#endif
2016-05-12 14:08:58 +08:00
class Post : public Table
{
Q_OBJECT
NUT_PRIMARY_AUTO_INCREMENT(id)
NUT_DECLARE_FIELD(int, id, id, setId)
NUT_NOT_NULL(title)
NUT_LEN(title, 50)
NUT_DECLARE_FIELD(QString, title, title, setTitle)
2016-05-21 16:09:03 +08:00
NUT_DECLARE_FIELD(QDateTime, saveDate, saveDate, setSaveDate)
2016-05-12 14:08:58 +08:00
NUT_DECLARE_FIELD(QString, body, body, setBody)
NUT_DECLARE_CHILD_TABLE(Comment, comments)
public:
explicit Post(QObject *tableSet = 0);
signals:
public slots:
};
2018-01-09 00:59:16 +08:00
Q_DECLARE_METATYPE(Post*)
2016-05-12 14:08:58 +08:00
#endif // USER_H