testhelper.cpp 608 B

12345678910111213141516171819202122232425262728
  1. #include "testhelper.h"
  2. #include <QJsonObject>
  3. #include <QJsonDocument>
  4. OCC::FolderDefinition folderDefinition(const QString &path)
  5. {
  6. OCC::FolderDefinition d;
  7. d.localPath = path;
  8. d.targetPath = path;
  9. d.alias = path;
  10. return d;
  11. }
  12. const QByteArray jsonValueToOccReply(const QJsonValue &jsonValue)
  13. {
  14. QJsonObject root;
  15. QJsonObject ocs;
  16. QJsonObject meta;
  17. meta.insert("statuscode", 200);
  18. ocs.insert(QStringLiteral("data"), jsonValue);
  19. ocs.insert(QStringLiteral("meta"), meta);
  20. root.insert(QStringLiteral("ocs"), ocs);
  21. return QJsonDocument(root).toJson();
  22. }