2018-01-14 22:03:24 +08:00
|
|
|
#ifndef SCORE_H
|
|
|
|
|
#define SCORE_H
|
|
|
|
|
|
2019-06-19 21:08:09 +08:00
|
|
|
#include <QUuid>
|
2020-07-31 00:13:57 +08:00
|
|
|
#include <QtNut/table.h>
|
2022-04-28 19:53:42 +08:00
|
|
|
#include <QSharedPointer>
|
|
|
|
|
#include <QMetaType>
|
|
|
|
|
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
|
|
|
Q_MOC_INCLUDE("user.h")
|
|
|
|
|
Q_MOC_INCLUDE("post.h")
|
|
|
|
|
#endif
|
2018-01-14 22:03:24 +08:00
|
|
|
|
|
|
|
|
class User;
|
|
|
|
|
class Post;
|
2022-04-28 19:53:42 +08:00
|
|
|
class Score : public NUT_WRAP_NAMESPACE(Table)
|
2018-01-14 22:03:24 +08:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
NUT_PRIMARY_AUTO_INCREMENT(id)
|
|
|
|
|
NUT_DECLARE_FIELD(int, id, id, setId)
|
|
|
|
|
|
|
|
|
|
NUT_DECLARE_FIELD(int, score, score, setScore)
|
|
|
|
|
|
2022-04-28 19:53:42 +08:00
|
|
|
NUT_DECLARE_FIELD(int, condition, condition, setCondition)
|
|
|
|
|
|
2019-06-26 23:06:44 +08:00
|
|
|
NUT_FOREIGN_KEY_DECLARE(Post, int, post, post, setPost)
|
|
|
|
|
NUT_FOREIGN_KEY_DECLARE(User, QUuid, author, author, setAuthor)
|
2018-01-14 22:03:24 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Q_INVOKABLE Score(QObject *parent = Q_NULLPTR);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // SCORE_H
|