mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
68 lines
4.3 KiB
C++
68 lines
4.3 KiB
C++
#include "httplib.h"
|
|
#include "common/JsonN.h"
|
|
#include "errcode.h"
|
|
|
|
class HttpEntity
|
|
{
|
|
public:
|
|
httplib::Server httpsvr;
|
|
HttpEntity();
|
|
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 queryStationInfo(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
Errcode queryStationData(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);
|
|
|
|
Errcode queryStatSystem(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
Errcode queryStatTotal(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
Errcode queryStatStation(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
Errcode queryStatDayList(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
|
|
Errcode queryEnvironment(const httplib::Request& req, httplib::Response& resp, NJsonNode& json);
|
|
}; |