123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- /*
- * @Description: 数据中心
- * @Version: 1.0
- * @Autor: lishengyin
- * @Date: 2022-04-02 13:58:46
- * @LastEditors: lishengyin
- * @LastEditTime: 2022-04-26 17:02:23
- */
- #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"){
- Init();
- }
-
- 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: 获取服务
- * @param {*}
- * @return {*}
- */
- bool getKsServices();
- /**
- * @description: 获取Ks Pods
- * @param {*}
- * @return {*}
- */
- bool getKsPods();
-
- /**
- * @description: 获取ksNodes
- * @param {*}
- * @return {*}
- */
- bool getKsNodes();
- /**
- * @description: 获取KsToken
- * @param {*}
- * @return {*}
- */
- bool getKsToken();
- /**
- * @description: 获取apollo的列表
- * @param {*}
- * @return {*}
- */
- bool getApolloList();
- /**
- * @description:
- * @param {*}
- * @return {*}
- */
- vector<vector<std::string>> ExecuteSql(std::string& sql);
- // describe
- /**
- * @description: 是否正常
- * @param {*}
- * @return {*}
- */
- bool isNormally() override{
- return true;
- }
- // DESCRIPTION
- };
- };
- #endif
|