2026-04-30 14:53:03 +08:00
|
|
|
#ifndef NEWSCONTROLLER_H
|
|
|
|
|
#define NEWSCONTROLLER_H
|
|
|
|
|
|
|
|
|
|
#include <QFuture>
|
|
|
|
|
#include <QJsonArray>
|
2026-05-15 12:33:36 +08:00
|
|
|
#include <QJsonObject>
|
2026-04-30 14:53:03 +08:00
|
|
|
#include <QPair>
|
|
|
|
|
|
|
|
|
|
#include "core/utils/errorCodes.h"
|
|
|
|
|
#include "core/utils/routeModes.h"
|
|
|
|
|
#include "core/utils/commonStructs.h"
|
|
|
|
|
#include "core/repositories/secureAppSettingsRepository.h"
|
2026-05-15 12:33:36 +08:00
|
|
|
#include "core/repositories/secureServersRepository.h"
|
2026-04-30 14:53:03 +08:00
|
|
|
|
|
|
|
|
class NewsController
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit NewsController(SecureAppSettingsRepository* appSettingsRepository,
|
2026-05-15 12:33:36 +08:00
|
|
|
SecureServersRepository* serversRepository);
|
2026-04-30 14:53:03 +08:00
|
|
|
|
|
|
|
|
QFuture<QPair<ErrorCode, QJsonArray>> fetchNews();
|
|
|
|
|
|
|
|
|
|
private:
|
2026-05-15 12:33:36 +08:00
|
|
|
QJsonObject getServicesList() const;
|
|
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
SecureAppSettingsRepository* m_appSettingsRepository;
|
2026-05-15 12:33:36 +08:00
|
|
|
SecureServersRepository* m_serversRepository;
|
2026-04-30 14:53:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // NEWSCONTROLLER_H
|