#ifndef APPSERVER_H
#define APPSERVER_H

#include <QTcpServer>
#include <QUuid>
#include <QRegExp>
#include <QDateTime>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>
#include <QList>
#include <QTimer>
#include "logthread.h"
#include "clientthread.h"

class AppServer : public QTcpServer
{
    Q_OBJECT
public:
    explicit AppServer(QObject *parent = nullptr);
    void start();

signals:

public slots:
    void incomingConnection(qintptr socketDescriptor) override;
    void commlog(QByteArray data, bool flag);
    void datalog(QString log);
    void timeout();

private:
    bool isWorking;
    uint UpTime;
    LogThread *logThread;
    QSqlDatabase db;
    QTimer *timer;
    QList<AppPData> AppPDataList;
};

#endif // APPSERVER_H
