123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef __HTTPPLUGIN_HPP_
- #define __HTTPPLUGIN_HPP_
- #include <iostream>
- #include "UtilBase.hpp"
- #include "Util/logger.h"
- #include "config.hpp"
- #include "HttpClient.hpp"
- #include "HttpServer.hpp"
- #include "requests.hpp"
- #include "ExpelDevice.h"
- #include "InfineFilter.hpp"
- #include "PluginSubscriber.hpp"
- using namespace std;
- using namespace toolkit;
- namespace gsd
- {
- class HttpPlugin: public PluginSubscriber<HttpPlugin>, public PluginBase
- {
- private:
- HttpPlugin(){
- }
- public:
- using Ptr = std::shared_ptr<HttpPlugin>;
- /**
- * @description: getPtr
- * @return {*}
- */
- static std::shared_ptr<HttpPlugin> getPtr();
- /**
- * @description: 初始化
- * @return {*}
- */
- bool Init();
- /**
- * @description: 启动任务
- * @return {*}
- */
- bool StartTask();
- /**
- * @description: 释放
- * @return {*}
- */
- void Destroy();
- /**
- * @description: 获取数据
- * @return {*}
- */
- void getHttpInfo();
- /**
- * @description: Alive
- * @return {*}
- */
- bool Alive();
- /**
- * @description: 纠察器
- * @param {string&} ImageBase64
- * @param {string&} datas
- * @return {*}
- */
- std::pair<bool, std::string> getCheck(std::string& ImageBase64, std::string& datas);
- /**
- * @description: RestPlugin
- * @return {*}
- */
- virtual bool RestPlugin();
- ~HttpPlugin(){}
- protected:
- std::shared_ptr<HttpClient> m_httpClient = nullptr;
- std::shared_ptr<HttpServer> m_HttpServer = nullptr;
- // timer
- Timer::Ptr timer0;
- };
- } // namespace gsd
- #endif
|