12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef __HTTPSERVER_HPP_
- #define __HTTPSERVER_HPP_
- #include <iostream>
- #include "UtilBase.hpp"
- #include "Util/logger.h"
- #include <httplib.h>
- #include "config.hpp"
- #include "Expel.hpp"
- using namespace std;
- using namespace toolkit;
- namespace gsd{
- class HttpServer: public ModuleBase
- {
- private:
- HttpServer(): ModuleBase(){
- }
- public:
- using Ptr = std::shared_ptr<HttpServer>;
- /**
- * @description: CreateNew
- * @return {*}
- */
- static std::shared_ptr<HttpServer> CreateNew();
- ~HttpServer(){}
- /**
- * @description: Init
- * @return {*}
- */
- virtual bool Init();
- /**
- * @description: Destroy
- * @return {*}
- */
- virtual void Destroy();
- protected:
- /**
- * @brief 服务
- */
- std::shared_ptr<httplib::Server> m_server = nullptr;
- };
- }
- #endif
|