/*
 * @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