123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- /*
- * @Description: 数据中心
- * @Version: 1.0
- * @Autor: lishengyin
- * @Date: 2022-04-02 13:58:46
- * @LastEditors: lishengyin
- * @LastEditTime: 2022-06-15 11:17:29
- */
- #ifndef __GETCENTER_HPP_
- #define __GETCENTER_HPP_
- #include <iostream>
- #include "Util/logger.h"
- #include "Util/NoticeCenter.h"
- #include "Poller/EventPoller.h"
- #include "Util/SqlPool.h"
- #include "Network/TcpClient.h"
- #include "Poller/Timer.h"
- #include "ins_base.hpp"
- #include "dataTypeList.hpp"
- #include "requests.h"
- #include "axios.h"
- using namespace std;
- using namespace toolkit;
- using namespace hv;
- namespace ins{
-
- class GetCenter:public Module
- {
- private:
- GetCenter() : Module("GetCenter"){
- }
-
- public:
- using Ptr = std::shared_ptr<GetCenter>;
- ~GetCenter(){this->Destroy();}
- /**
- * @description: 初始化
- * @param {*}
- * @return {*}
- */
- int8_t Init() override;
- /**
- * @description: 释放资源
- * @param {*}
- * @return {*}
- */
- void Destroy() override;
- /**
- * @description: 创建新的实例
- * @param {*}
- * @return {*}
- */
- static std::shared_ptr<GetCenter> CreateNew();
- /**
- * @description: 获取ptr
- * @param {*}
- * @return {*}
- */
- static std::shared_ptr<GetCenter> getPtr();
- /**
- * @description: 获取KsToken
- * @param {*}
- * @return {*}
- */
- bool getKsToken();
- /**
- * @description: 分析格式
- * @param {string} type
- * @param {string} URL
- * @return {*}
- */
- InsDataFormat getFormat(std::string type, std::string URL);
- /**
- * @description: 获取包类型
- * @param {string} type
- * @return {*}
- */
- InsPacketTypes getPacketType(std::string type);
- /**
- * @description: 获取数据
- * @param {*}
- * @return {*}
- */
- bool getData();
- /**
- * @description:
- * @param {*}
- * @return {*}
- */
- vector<vector<std::string>> ExecuteSql(std::string& sql);
- /**
- * @description: 是否正常
- * @param {*}
- * @return {*}
- */
- bool isNormally() override{
- return true;
- }
- // DESCRIPTION
- public:
- Timer::Ptr timer = nullptr;
- };
- };
- #endif
|