1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef __HEPU_H__
- #define __HEPU_H__
- #include <iostream>
- #include <time.h>
- #include <ctime>
- #include "Util/util.h"
- #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 "TCPClient.hpp"
- #include <httplib.h>
- #include "Notices.h"
- #include "md5.h"
- #include "UtilBase.hpp"
- #include "HepuHB.h"
- #include "HepuHBRe.h"
- #include "HepuLogin.h"
- #include "HepuLoginRe.h"
- #include "HepuTarget.h"
- #include "HepuTargetRe.h"
- #include "HepuGetSalt.h"
- #include "HepuGetSaltRe.h"
- #include "HepuTarget2.h"
- #include "HepuTarget2Re.h"
- using namespace std;
- using namespace toolkit;
- namespace gsd{
- class Hepu: public enable_shared_from_this<Hepu>, public ModuleBase
- {
- private:
- string username_;
- string password_;
- string token_;
- string url_;
- string salt_;
- int port_;
- public:
- Hepu(){}
- ~Hepu(){}
- virtual bool Init(){
- return true;
- }
- virtual void Destroy(){
- }
- int32_t Init(string username, string url, int port);
- int32_t Init2();
- static std::shared_ptr<Hepu> CreateNew();
- int32_t LoginHepu();
- bool alive();
- int32_t getSalt(HepuGetSalt& hepuGetSaltMsg);
- int32_t getSalt();
- int32_t sendHepuHB(HepuHB& hepuHBMsg);
- int32_t sendHepuHB();
- int32_t sendHepuTarget(HepuTarget& hepuTargetMsg);
- int32_t sendHepuTarget2(HepuTarget2& hepuTargetMsg);
- void setUsr(string usr);
- void setPwd(string pwd);
- void setUrl(string url);
- void setPort(int port);
- };
- };
- #endif
|