Попытка раскидать по библиотекам

This commit is contained in:
2025-03-16 10:46:06 +05:00
parent d47988adda
commit 394c55ae5c
15 changed files with 129 additions and 42 deletions

View File

@@ -0,0 +1,29 @@
#ifndef RESTAPISERVER_H
#define RESTAPISERVER_H
#include <odb/database.hxx>
#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
class Q_DECL_EXPORT RestApiServer : public QTcpServer
{
Q_OBJECT
public:
explicit RestApiServer(odb::core::database& db, QObject* parent = nullptr);
void start(quint16 port = 8080);
protected:
void incomingConnection(qintptr socketDescriptor) override;
private slots:
void handleRequest();
private:
QByteArray processRequest(const QString& request);
odb::core::database& m_db;
};
#endif // RESTAPISERVER_H