Nut/tests/auto/common/comment.h

34 lines
764 B
C
Raw Normal View History

2016-05-12 14:08:58 +08:00
#ifndef COMMENT_H
#define COMMENT_H
#include <QtCore/qglobal.h>
#include <QtCore/QDateTime>
2020-07-31 00:13:57 +08:00
#include <QtNut/table.h>
2016-05-12 14:08:58 +08:00
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;
2018-01-09 00:59:16 +08:00
class User;
2016-05-12 14:08:58 +08:00
class Comment : public Table
{
Q_OBJECT
2019-02-08 17:11:53 +08:00
NUT_PRIMARY_AUTO_INCREMENT(id)
NUT_DECLARE_FIELD(int, id, id, setId)
2016-05-12 14:08:58 +08:00
NUT_DECLARE_FIELD(QString, message, message, setMessage)
NUT_DECLARE_FIELD(QDateTime, saveDate, saveDate, setSaveDate)
2016-05-21 16:09:03 +08:00
NUT_DECLARE_FIELD(qreal, point, point, setPoint)
2016-05-12 14:08:58 +08:00
2019-06-26 23:06:44 +08:00
NUT_FOREIGN_KEY_DECLARE(Post, int, post, post, setPost)
NUT_FOREIGN_KEY_DECLARE(User, int, author, author, setAuthor)
2016-05-12 14:08:58 +08:00
public:
2018-10-15 22:34:50 +08:00
Q_INVOKABLE explicit Comment(QObject *parentTableSet = nullptr);
2016-05-12 14:08:58 +08:00
};
2018-01-09 00:59:16 +08:00
Q_DECLARE_METATYPE(Comment*)
2016-05-12 14:08:58 +08:00
#endif // COMMENT_H