Добавлена таблица Settings

This commit is contained in:
2025-08-05 09:33:05 +05:00
parent 8cb56837f5
commit 89b43f5aad
9 changed files with 47 additions and 15 deletions

View File

@@ -28,11 +28,11 @@
using oDBase = odb::sqlite::database;
using uDBase = U<oDBase>;
#include <model/author_book_s-odb.hxx>
#include <model/author_book_s.h>
#include <model/author_s-odb.hxx>
#include <model/author_s.h>
#include <model/book_s-odb.hxx>
#include <model/book_s.h>
#include <model/books/author_book_s-odb.hxx>
#include <model/books/author_book_s.h>
#include <model/books/author_s-odb.hxx>
#include <model/books/author_s.h>
#include <model/books/book_s-odb.hxx>
#include <model/books/book_s.h>
void DATABASE_EXPORT addBook(oDBase& db, const QString title, const QVector<QString>& authors);

View File

@@ -1,7 +1,7 @@
#ifndef AUTHOR_BOOK_H
#define AUTHOR_BOOK_H
#include "model_global.h"
#include <model/model_global.h>
#include "author_s.h"
#include "book_s.h"

View File

@@ -1,7 +1,7 @@
#ifndef AUTHOR_S_H
#define AUTHOR_S_H
#include "model_global.h"
#include <model/model_global.h>
// @JsonSerializer
class Author_S;

View File

@@ -1,7 +1,7 @@
#ifndef BOOK_S_H
#define BOOK_S_H
#include "model_global.h"
#include <model/model_global.h>
#include <QDateTime>

View File

@@ -1,7 +1,7 @@
#ifndef GENRE_H
#define GENRE_H
#include "model_global.h"
#include <model/model_global.h>
#pragma db object
class MODEL_EXPORT Genre_S

View File

@@ -1,7 +1,7 @@
#ifndef SERIES_H
#define SERIES_H
#include "model_global.h"
#include <model/model_global.h>
#pragma db object
class MODEL_EXPORT Series_S

View File

@@ -26,12 +26,21 @@ PSLibrary {
odb.gen.databases: "sqlite"
cpp.cxxLanguageVersion: "c++17"
Group {
id: headers
name: "headers"
files: [
"model_global.h",
]
}
Group {
id: odbs
name: "odb"
files: [
"**/*.h",
]
excludeFiles: headers.files
fileTags: ["hpp", "odbxx", "rgen"]
}

View File

@@ -0,0 +1,23 @@
#ifndef SETTINGS_S_H
#define SETTINGS_S_H
#include <model/model_global.h>
#pragma db object
class MODEL_EXPORT Settings_S
{
public:
Settings_S() = default;
quint64 id() const { return m_id; }
void setId(const quint64& newId) { m_id = newId; }
private:
friend class odb::access;
private:
#pragma db id auto
quint64 m_id;
};
#endif // SETTINGS_S_H

View File

@@ -5,10 +5,10 @@
#include <QJsonObject>
#include <QJsonValue>
#include <model/author_s-odb.hxx> // Должен быть здесь
#include <model/author_s.h>
#include <model/book_s-odb.hxx> // Должен быть здесь
#include <model/book_s.h>
#include <model/books/author_s-odb.hxx> // Должен быть здесь
#include <model/books/author_s.h>
#include <model/books/book_s-odb.hxx> // Должен быть здесь
#include <model/books/book_s.h>
#include <odb/core.hxx>
#include <odb/database.hxx>