Nut/test/common/comment.h

35 lines
761 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>
2018-04-08 23:16:44 +08:00
#include <QtCore/QUuid>
2016-05-12 14:08:58 +08:00
#include "table.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;
2018-01-09 00:59:16 +08:00
class User;
2016-05-12 14:08:58 +08:00
class Comment : public Table
{
Q_OBJECT
2018-10-15 22:34:50 +08:00
NUT_PRIMARY_KEY(id)
2018-04-08 23:16:44 +08:00
NUT_DECLARE_FIELD(QUuid, 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
NUT_FOREGION_KEY(Post, int, post, post, setPost)
2018-04-08 23:16:44 +08:00
NUT_FOREGION_KEY(User, QUuid, 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