aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/BaseAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/BaseAPI.h')
-rw-r--r--src/server/BaseAPI.h51
1 files changed, 22 insertions, 29 deletions
diff --git a/src/server/BaseAPI.h b/src/server/BaseAPI.h
index 0b724bbc..46766fed 100644
--- a/src/server/BaseAPI.h
+++ b/src/server/BaseAPI.h
@@ -1,7 +1,7 @@
/**
- * This file is part of GPGFrontend.
+ * This file is part of GpgFrontend.
*
- * GPGFrontend is free software: you can redistribute it and/or modify
+ * GpgFrontend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@@ -25,49 +25,42 @@
#ifndef GPGFRONTEND_ZH_CN_TS_BASEAPI_H
#define GPGFRONTEND_ZH_CN_TS_BASEAPI_H
-#include "GpgFrontend.h"
#include "ComUtils.h"
-
+#include "GpgFrontend.h"
#include "rapidjson/document.h"
class BaseAPI : public QObject {
-Q_OBJECT
-public:
-
- explicit BaseAPI(ComUtils::ServiceType serviceType);
-
- ~BaseAPI() override;
+ Q_OBJECT
+ public:
+ explicit BaseAPI(ComUtils::ServiceType serviceType);
- void start();
+ ~BaseAPI() override;
- void refresh();
+ void start();
- [[nodiscard]] bool result() const;
+ void refresh();
-private:
+ [[nodiscard]] bool result() const;
- ComUtils *utils;
+ private:
+ ComUtils *utils;
- QUrl reqUrl;
+ QUrl reqUrl;
- QNetworkRequest request;
+ QNetworkRequest request;
- QNetworkReply *send_json_data();
+ QNetworkReply *send_json_data();
-protected:
+ protected:
+ bool good = false;
- bool good = false;
+ rapidjson::Document document;
- rapidjson::Document document;
-
- const ComUtils &getUtils() { return *utils; };
-
- virtual void construct_json() = 0;
-
- virtual void deal_reply() = 0;
+ const ComUtils &getUtils() { return *utils; };
+ virtual void construct_json() = 0;
+ virtual void deal_reply() = 0;
};
-
-#endif //GPGFRONTEND_ZH_CN_TS_BASEAPI_H
+#endif // GPGFRONTEND_ZH_CN_TS_BASEAPI_H