1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef __HTTPPLUGIN_HPP_
- #define __HTTPPLUGIN_HPP_
- #include <iostream>
- #include "UtilBase.hpp"
- #include "Util/logger.h"
- #include "config.hpp"
- #include "HttpClient.hpp"
- #include "requests.hpp"
- #include "ExpelDevice.h"
- #include "InfineFilter.hpp"
- using namespace std;
- using namespace toolkit;
- namespace gsd
- {
- class HttpPlugin: public enable_shared_from_this<HttpPlugin>, public PluginBase
- {
- private:
- HttpPlugin(){
- InfoL;
- }
- public:
- using Ptr = std::shared_ptr<HttpPlugin>;
- /**
- * @description: CreateNew
- * @return {*}
- */
- static std::shared_ptr<HttpPlugin> CreateNew();
- /**
- * @description: 初始化
- * @return {*}
- */
- bool Init();
- /**
- * @description: 启动任务
- * @return {*}
- */
- bool StartTask();
- /**
- * @description: 释放
- * @return {*}
- */
- void Destroy();
- /**
- * @description: 获取数据
- * @return {*}
- */
- void getHttpInfo();
- /**
- * @description: Alive
- * @return {*}
- */
- bool Alive(){
- return true;
- }
-
- ~HttpPlugin(){}
- protected:
- std::shared_ptr<HttpClient> m_httpClient = nullptr;
- // timer
- Timer::Ptr timer0;
- };
- } // namespace gsd
- #endif
|