HttpServer.hpp 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef __HTTPSERVER_HPP_
  2. #define __HTTPSERVER_HPP_
  3. #include <iostream>
  4. #include "UtilBase.hpp"
  5. #include "Util/logger.h"
  6. #include <httplib.h>
  7. #include "config.hpp"
  8. #include "Expel.hpp"
  9. using namespace std;
  10. using namespace toolkit;
  11. namespace gsd{
  12. class HttpServer: public ModuleBase
  13. {
  14. private:
  15. HttpServer(): ModuleBase(){
  16. InfoL;
  17. }
  18. public:
  19. using Ptr = std::shared_ptr<HttpServer>;
  20. /**
  21. * @description: CreateNew
  22. * @return {*}
  23. */
  24. static std::shared_ptr<HttpServer> CreateNew();
  25. ~HttpServer(){}
  26. /**
  27. * @description: Init
  28. * @return {*}
  29. */
  30. virtual bool Init();
  31. /**
  32. * @description: Destroy
  33. * @return {*}
  34. */
  35. virtual void Destroy();
  36. protected:
  37. /**
  38. * @brief 服务
  39. */
  40. std::shared_ptr<httplib::Server> m_server = nullptr;
  41. };
  42. }
  43. #endif