34 lines
779 B
C
34 lines
779 B
C
|
#ifndef SENSORGROUPS_R_H
|
||
|
#define SENSORGROUPS_R_H
|
||
|
|
||
|
#include <QString>
|
||
|
#include <QJsonDocument>
|
||
|
#include <QJsonObject>
|
||
|
#include <QJsonArray>
|
||
|
#include <QStringList>
|
||
|
|
||
|
class GetSensorsGroupsR {
|
||
|
public:
|
||
|
GetSensorsGroupsR() = default;
|
||
|
|
||
|
void parseResponse(const QJsonObject& responseObj) {
|
||
|
if (responseObj.contains("groups") && responseObj["groups"].isArray()) {
|
||
|
QJsonArray groupsArray = responseObj["groups"].toArray();
|
||
|
for (const QJsonValue& value : groupsArray) {
|
||
|
if (value.isString()) {
|
||
|
groups.append(value.toString());
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const QStringList& getGroups() const {
|
||
|
return groups;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
QStringList groups;
|
||
|
};
|
||
|
|
||
|
#endif // SENSORGROUPS_R_H
|