28 lines
537 B
C++
28 lines
537 B
C++
#ifndef HTTP_SERVER_H_
|
|
#define HTTP_SERVER_H_
|
|
|
|
#include <httplib.h>
|
|
#include "color.h"
|
|
#include "conveyorBeltController.h"
|
|
#include <glog/logging.h>
|
|
#include <json/json.h>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <thread>
|
|
|
|
class HttpServer {
|
|
public:
|
|
void Init();
|
|
void Run();
|
|
|
|
private:
|
|
// http服务器
|
|
std::shared_ptr<httplib::Server> server;
|
|
// 控制器
|
|
std::shared_ptr<ConveyorBeltController> controller;
|
|
std::map<int, int> directionMap;
|
|
std::map<int, std::string> ipMap;
|
|
};
|
|
|
|
#endif // HTTP_SERVER_H_
|