mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现HTTP服务架构
This commit is contained in:
58
src/protocol/HttpEntity.h
Normal file
58
src/protocol/HttpEntity.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "httplib.h"
|
||||
#include "common/JsonN.h"
|
||||
#include "errcode.h"
|
||||
|
||||
class HttpEntity
|
||||
{
|
||||
public:
|
||||
httplib::Server httpsvr;
|
||||
void listen(std::string addr, int port);
|
||||
void registGet(std::string name, void (HttpEntity::* func)(const httplib::Request& req, httplib::Response& resp));
|
||||
|
||||
//void onGet(const httplib::Request& req, httplib::Response& resp);
|
||||
|
||||
Errcode login(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryUserList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertUser(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateUser(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deleteUser(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryPermissionList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertPermission(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updatePermission(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deletePermission(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
|
||||
Errcode queryRoleList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertRole(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateRole(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deleteRole(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryStationList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertStation(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateStation(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deleteStation(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryDeviceList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertDevice(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateDevice(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deleteDevice(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode queryDevicTypeDef(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryPolicyList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode insertPolicy(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updatePolicy(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode deletePolicy(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode querySystemLogList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
//Errcode insertSystemLog(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateSystemLog(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryAlertLogList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
//Errcode insertAlertLog(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
Errcode updateAlertLog(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
Errcode queryPredictionDetail(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user