|
|
@ -175,7 +175,7 @@ json MainControlService::createSensorDataJson() { |
|
|
|
return report; |
|
|
|
} |
|
|
|
// {"command":"startReplenishingFluids","messageId":"startReplenishingFluids","stopAt":123}
|
|
|
|
void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
void MainControlService::processFrontEndMessage_userOperate(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
/*******************************************************************************
|
|
|
|
* LOGIN_CMD * |
|
|
@ -184,25 +184,21 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
string uid = cmd["userid"]; |
|
|
|
|
|
|
|
string pwd = cmd["passwd"]; |
|
|
|
if (pwd == "rootiflytop9973") { |
|
|
|
m_deviceStateService->setLoginState("root", 0, 1); |
|
|
|
logger->info("user {} login success", "root"); |
|
|
|
if (uid == "admin" && pwd == "iflytop9973") { |
|
|
|
m_deviceStateService->setLoginState("admin", 0, 1); |
|
|
|
logger->info("user {} login success", "admin"); |
|
|
|
} else { |
|
|
|
auto usr = m_dbService->getUser(uid); |
|
|
|
if (usr == nullptr) { |
|
|
|
logger->warn("login fail, user {} not exist", uid); |
|
|
|
if (!m_dbService->isUserExist(uid)) { |
|
|
|
receipt["ackcode"] = err::error_code_get_get_ecode(err::kce, err::kuser_not_exist); |
|
|
|
receipt["ackcodeInfo"] = err::error_code_get_desc(err::kce, err::kuser_not_exist, ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (usr->passwd != pwd) { |
|
|
|
logger->warn("login fail, user {} passwd error", uid); |
|
|
|
if (!m_dbService->ispasswdCorrect(uid, pwd)) { |
|
|
|
receipt["ackcode"] = err::error_code_get_get_ecode(err::kce, err::kpasswd_error); |
|
|
|
receipt["ackcodeInfo"] = err::error_code_get_desc(err::kce, err::kpasswd_error, ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
m_deviceStateService->setLoginState(uid, usr->permission_level, usr->visible); |
|
|
|
m_deviceStateService->setLoginState(uid, m_dbService->getUser(uid)->permission_level, m_dbService->getUser(uid)->visible); |
|
|
|
logger->info("user {} login success", uid); |
|
|
|
} |
|
|
|
|
|
|
@ -222,23 +218,21 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
* chpasswd * |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "chpasswd") { |
|
|
|
string uid = cmd["userid"]; |
|
|
|
string pwd = cmd["passwd"]; |
|
|
|
logger->info("changet passwd {} {}", uid, pwd); |
|
|
|
string uid = cmd["userId"]; |
|
|
|
string newpasswd = cmd["newpasswd"]; |
|
|
|
string passwd = cmd["passwd"]; |
|
|
|
logger->info("changet passwd {} {}", uid, passwd); |
|
|
|
if (!m_dbService->isUserExist(uid)) { |
|
|
|
receipt["ackcode"] = err::error_code_get_get_ecode(err::kce, err::kuser_not_exist); |
|
|
|
receipt["ackcodeInfo"] = err::error_code_get_desc(err::kce, err::kuser_not_exist, ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* shutdown * |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "shutdown") { |
|
|
|
int delayms = jsonGet<int>(cmd["delayms"]); |
|
|
|
logger->info("shutdown {} ms", delayms); |
|
|
|
m_autoshutdownThread.reset(new Thread("autoShutdown", [delayms, this]() { |
|
|
|
ThisThread thisThread; |
|
|
|
thisThread.sleepForMs(delayms); |
|
|
|
dosystem("shutdown -h now"); |
|
|
|
})); |
|
|
|
if (!m_dbService->ispasswdCorrect(uid, passwd)) { |
|
|
|
receipt["ackcode"] = err::error_code_get_get_ecode(err::kce, err::kpasswd_error); |
|
|
|
receipt["ackcodeInfo"] = err::error_code_get_desc(err::kce, err::kpasswd_error, ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
m_dbService->changePasswd(uid, newpasswd); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -260,6 +254,27 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
m_dbService->updateUserPermissionLevel(id, permission_level); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (cmdstr == "getAllUser") { |
|
|
|
auto users = m_dbService->getAllUserJson(); |
|
|
|
receipt["dbval"] = users; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
void MainControlService::processFrontEndMessage_systemOperate(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
/*******************************************************************************
|
|
|
|
* shutdown * |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "shutdown") { |
|
|
|
int delayms = jsonGet<int>(cmd["delayms"]); |
|
|
|
logger->info("shutdown {} ms", delayms); |
|
|
|
m_autoshutdownThread.reset(new Thread("autoShutdown", [delayms, this]() { |
|
|
|
ThisThread thisThread; |
|
|
|
thisThread.sleepForMs(delayms); |
|
|
|
dosystem("shutdown -h now"); |
|
|
|
})); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdstr == "updateDate") { |
|
|
|
#if 0
|
|
|
@ -302,72 +317,43 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainControlService::processFrontEndMessage_Disinfection(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
/*******************************************************************************
|
|
|
|
* 消毒相关指令 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
if (cmdstr == "startDisinfection2") { |
|
|
|
int loglevel = jsonGet<int>(cmd["loglevel"]); |
|
|
|
int injection_pump_speed = jsonGet<int>(cmd["injection_pump_speed"]); //
|
|
|
|
int stoped_gs = jsonGet<int>(cmd["stoped_gs"]); //
|
|
|
|
int continued_gs = jsonGet<int>(cmd["continued_gs"]); //
|
|
|
|
int stoped_satur = jsonGet<int>(cmd["stoped_satur"]); //
|
|
|
|
int continued_satur = jsonGet<int>(cmd["continued_satur"]); //
|
|
|
|
int stoped_humi = jsonGet<int>(cmd["stoped_humi"]); //
|
|
|
|
int continued_humi = jsonGet<int>(cmd["continued_humi"]); //
|
|
|
|
|
|
|
|
m_disinfectionCtrlService->startDisinfection(loglevel, //
|
|
|
|
injection_pump_speed, //
|
|
|
|
stoped_gs, //
|
|
|
|
continued_gs, //
|
|
|
|
stoped_satur, //
|
|
|
|
continued_satur, //
|
|
|
|
stoped_humi, //
|
|
|
|
continued_humi //
|
|
|
|
); |
|
|
|
m_disinfectionCtrlService->startDisinfection(jsonGet<int>(cmd["loglevel"]), |
|
|
|
jsonGet<int>(cmd["injection_pump_speed"]), //
|
|
|
|
jsonGet<int>(cmd["stoped_gs"]), //
|
|
|
|
jsonGet<int>(cmd["continued_gs"]), |
|
|
|
jsonGet<int>(cmd["stoped_satur"]), //
|
|
|
|
jsonGet<int>(cmd["continued_satur"]), //
|
|
|
|
jsonGet<int>(cmd["stoped_humi"]), |
|
|
|
jsonGet<int>(cmd["continued_humi"])); //
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdstr == "startDisinfection") { |
|
|
|
int loglevel = jsonGet<int>(cmd["loglevel"]); |
|
|
|
|
|
|
|
int injection_pump_speed = m_dbService->getSettingVal("injection_pump_speed"); |
|
|
|
int stoped_gs = m_dbService->getSettingVal("stoped_gs"); |
|
|
|
int continued_gs = m_dbService->getSettingVal("continued_gs"); |
|
|
|
int stoped_satur = m_dbService->getSettingVal("stoped_satur"); |
|
|
|
int continued_satur = m_dbService->getSettingVal("continued_satur"); |
|
|
|
int stoped_humi = m_dbService->getSettingVal("stoped_humi"); |
|
|
|
int continued_humi = m_dbService->getSettingVal("continued_humi"); |
|
|
|
|
|
|
|
m_disinfectionCtrlService->startDisinfection(loglevel, //
|
|
|
|
injection_pump_speed, //
|
|
|
|
stoped_gs, //
|
|
|
|
continued_gs, //
|
|
|
|
stoped_satur, //
|
|
|
|
continued_satur, //
|
|
|
|
stoped_humi, //
|
|
|
|
continued_humi //
|
|
|
|
); |
|
|
|
m_disinfectionCtrlService->startDisinfection(jsonGet<int>(cmd["loglevel"]), //
|
|
|
|
m_dbService->getSettingVal("injection_pump_speed"), //
|
|
|
|
m_dbService->getSettingVal("stoped_gs"), //
|
|
|
|
m_dbService->getSettingVal("continued_gs"), //
|
|
|
|
m_dbService->getSettingVal("stoped_satur"), //
|
|
|
|
m_dbService->getSettingVal("continued_satur"), //
|
|
|
|
m_dbService->getSettingVal("stoped_humi"), //
|
|
|
|
m_dbService->getSettingVal("continued_humi")); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdstr == "changeDisinfectionParameter") { |
|
|
|
int injection_pump_speed = jsonGet<int>(cmd["injection_pump_speed"]); //
|
|
|
|
int stoped_gs = jsonGet<int>(cmd["stoped_gs"]); //
|
|
|
|
int continued_gs = jsonGet<int>(cmd["continued_gs"]); //
|
|
|
|
int stoped_satur = jsonGet<int>(cmd["stoped_satur"]); //
|
|
|
|
int continued_satur = jsonGet<int>(cmd["continued_satur"]); //
|
|
|
|
int stoped_humi = jsonGet<int>(cmd["stoped_humi"]); //
|
|
|
|
int continued_humi = jsonGet<int>(cmd["continued_humi"]); //
|
|
|
|
m_disinfectionCtrlService->changeDisinfectionParameter( //
|
|
|
|
injection_pump_speed, //
|
|
|
|
stoped_gs, //
|
|
|
|
continued_gs, //
|
|
|
|
stoped_satur, //
|
|
|
|
continued_satur, //
|
|
|
|
stoped_humi, //
|
|
|
|
continued_humi //
|
|
|
|
); |
|
|
|
m_disinfectionCtrlService->changeDisinfectionParameter(jsonGet<int>(cmd["injection_pump_speed"]), //
|
|
|
|
jsonGet<int>(cmd["stoped_gs"]), //
|
|
|
|
jsonGet<int>(cmd["continued_gs"]), //
|
|
|
|
jsonGet<int>(cmd["stoped_satur"]), //
|
|
|
|
jsonGet<int>(cmd["continued_satur"]), //
|
|
|
|
jsonGet<int>(cmd["stoped_humi"]), //
|
|
|
|
jsonGet<int>(cmd["continued_humi"])); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -376,25 +362,6 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
#if 0
|
|
|
|
//开始加液
|
|
|
|
{ |
|
|
|
"command":"startReplenishingFluids", |
|
|
|
} |
|
|
|
//停止加液
|
|
|
|
{ |
|
|
|
"command":"stopReplenishingFluids", |
|
|
|
} |
|
|
|
//开始排液
|
|
|
|
{ |
|
|
|
"command":"startDraining", |
|
|
|
} |
|
|
|
//停止排液
|
|
|
|
{ |
|
|
|
"command":"stopDraining", |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (cmdstr == "startReplenishingFluids") { |
|
|
|
int16_t stopAt = jsonGet<int>(cmd["stopAt"]); |
|
|
|
logger->info("startReplenishingFluids {}", stopAt); |
|
|
@ -419,55 +386,9 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
m_disinfectionCtrlService->stopDraining(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* getState * |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "getState") { |
|
|
|
receipt["state"]["isLogin"] = m_deviceStateService->isLogin(); |
|
|
|
receipt["state"]["loginuser"] = m_deviceStateService->getLoginUid(); |
|
|
|
receipt["state"]["permissionLevel"] = m_deviceStateService->getLoginPermissionLevel(); |
|
|
|
// receipt["state"]["workState"] = m_disinfectionCtrlService->isDisinfectionRunning();
|
|
|
|
|
|
|
|
receipt["state"]["disinfectionWorkState"] = m_disinfectionCtrlService->getDisinfectionWorkState(); |
|
|
|
receipt["state"]["replenishingFluidsWorkState"] = m_disinfectionCtrlService->getReplenishingFluidsWorkState(); |
|
|
|
receipt["state"]["drainingWorkState"] = m_disinfectionCtrlService->getDrainingWorkState(); |
|
|
|
|
|
|
|
receipt["state"]["estimatedRemainingTimeS"] = m_disinfectionCtrlService->getEstimatedRemainingTimeS(); |
|
|
|
receipt["state"]["disinfection_id"] = m_disinfectionCtrlService->getDisinfectionID(); |
|
|
|
// receipt["state"]["preHeat"] = m_disinfectionCtrlService->processPreheatState
|
|
|
|
// getPreHeatRaminTimeS
|
|
|
|
// isPreheatState
|
|
|
|
receipt["state"]["preHeat"] = m_disinfectionCtrlService->isPreheatState(); |
|
|
|
receipt["state"]["preHeatRaminTimeS"] = m_disinfectionCtrlService->getPreHeatRaminTimeS(); // 预热剩余时间
|
|
|
|
|
|
|
|
receipt["state"]["sensor_data"] = createSensorDataJson(); |
|
|
|
|
|
|
|
receipt["disinfectionConfig"]["loglevel"] = m_disinfectionCtrlService->m_context.m_targetLoglevel; |
|
|
|
receipt["disinfectionConfig"]["injection_pump_speed"] = m_disinfectionCtrlService->m_context.injection_pump_speed; |
|
|
|
receipt["disinfectionConfig"]["stoped_gs"] = m_disinfectionCtrlService->m_context.stoped_gs; |
|
|
|
receipt["disinfectionConfig"]["continued_gs"] = m_disinfectionCtrlService->m_context.continued_gs; |
|
|
|
receipt["disinfectionConfig"]["stoped_satur"] = m_disinfectionCtrlService->m_context.stoped_satur; |
|
|
|
receipt["disinfectionConfig"]["continued_satur"] = m_disinfectionCtrlService->m_context.continued_satur; |
|
|
|
receipt["disinfectionConfig"]["stoped_humi"] = m_disinfectionCtrlService->m_context.stoped_humi; |
|
|
|
receipt["disinfectionConfig"]["continued_humi"] = m_disinfectionCtrlService->m_context.continued_humi; |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// // 排液泵
|
|
|
|
// void drainingPump_open();
|
|
|
|
// void drainingPump_close();
|
|
|
|
// // 充液泵
|
|
|
|
// void replenishingFluidsPump_open();
|
|
|
|
// void replenishingFluidsPump_close();
|
|
|
|
// // 喷液泵
|
|
|
|
// void sprayLiquidPump_open(int gpm);
|
|
|
|
// void sprayLiquidPump_close();
|
|
|
|
// int sprayLiquidPump_getState();
|
|
|
|
// int sprayLiquidPump_getRPM();
|
|
|
|
// int sprayLiquidPump_getGPM();
|
|
|
|
#if 1
|
|
|
|
} |
|
|
|
void MainControlService::processFrontEndMessage_test(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
if (cmdstr == "test_sprayLiquidPumpCtrl") { |
|
|
|
int ctrl = jsonGet<int>(cmd["ctrl"]); |
|
|
|
int speed = jsonGet<int>(cmd["speed"]); |
|
|
@ -493,8 +414,6 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 执行测试指令 * |
|
|
|
*******************************************************************************/ |
|
|
@ -513,30 +432,16 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 数据库查询 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
if (cmdstr == "getAllUser") { |
|
|
|
auto users = m_dbService->getAllUserJson(); |
|
|
|
receipt["dbval"] = users; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
void MainControlService::processFrontEndMessage_setting(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
if (cmdstr == "getAllSetting") { |
|
|
|
auto dbval = m_dbService->getAllSettingJson(); |
|
|
|
receipt["dbval"] = dbval; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdstr == "getAllRecords") { |
|
|
|
string disinfection_id = cmd["disinfection_id"]; |
|
|
|
auto dbval = m_dbService->getAllRecords(disinfection_id); |
|
|
|
receipt["dbval"] = dbval; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdstr == "setSettingVal") { |
|
|
|
string settingName = cmd["settingName"]; |
|
|
|
int settingVal = jsonGet<int>(cmd["settingVal"]); |
|
|
@ -549,21 +454,56 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
processFrontEndMessage_userOperate(webSocket, cmd, receipt); |
|
|
|
processFrontEndMessage_systemOperate(webSocket, cmd, receipt); |
|
|
|
processFrontEndMessage_Disinfection(webSocket, cmd, receipt); |
|
|
|
processFrontEndMessage_test(webSocket, cmd, receipt); |
|
|
|
processFrontEndMessage_setting(webSocket, cmd, receipt); |
|
|
|
/*******************************************************************************
|
|
|
|
* getState * |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "getState") { |
|
|
|
receipt["state"]["isLogin"] = m_deviceStateService->isLogin(); |
|
|
|
receipt["state"]["loginuser"] = m_deviceStateService->getLoginUid(); |
|
|
|
receipt["state"]["permissionLevel"] = m_deviceStateService->getLoginPermissionLevel(); |
|
|
|
// receipt["state"]["workState"] = m_disinfectionCtrlService->isDisinfectionRunning();
|
|
|
|
|
|
|
|
receipt["state"]["disinfectionWorkState"] = m_disinfectionCtrlService->getDisinfectionWorkState(); |
|
|
|
receipt["state"]["replenishingFluidsWorkState"] = m_disinfectionCtrlService->getReplenishingFluidsWorkState(); |
|
|
|
receipt["state"]["drainingWorkState"] = m_disinfectionCtrlService->getDrainingWorkState(); |
|
|
|
|
|
|
|
receipt["state"]["estimatedRemainingTimeS"] = m_disinfectionCtrlService->getEstimatedRemainingTimeS(); |
|
|
|
receipt["state"]["disinfection_id"] = m_disinfectionCtrlService->getDisinfectionID(); |
|
|
|
// receipt["state"]["preHeat"] = m_disinfectionCtrlService->processPreheatState
|
|
|
|
// getPreHeatRaminTimeS
|
|
|
|
// isPreheatState
|
|
|
|
receipt["state"]["preHeat"] = m_disinfectionCtrlService->isPreheatState(); |
|
|
|
receipt["state"]["preHeatRaminTimeS"] = m_disinfectionCtrlService->getPreHeatRaminTimeS(); // 预热剩余时间
|
|
|
|
|
|
|
|
receipt["state"]["sensor_data"] = createSensorDataJson(); |
|
|
|
|
|
|
|
receipt["disinfectionConfig"]["loglevel"] = m_disinfectionCtrlService->m_context.m_targetLoglevel; |
|
|
|
receipt["disinfectionConfig"]["injection_pump_speed"] = m_disinfectionCtrlService->m_context.injection_pump_speed; |
|
|
|
receipt["disinfectionConfig"]["stoped_gs"] = m_disinfectionCtrlService->m_context.stoped_gs; |
|
|
|
receipt["disinfectionConfig"]["continued_gs"] = m_disinfectionCtrlService->m_context.continued_gs; |
|
|
|
receipt["disinfectionConfig"]["stoped_satur"] = m_disinfectionCtrlService->m_context.stoped_satur; |
|
|
|
receipt["disinfectionConfig"]["continued_satur"] = m_disinfectionCtrlService->m_context.continued_satur; |
|
|
|
receipt["disinfectionConfig"]["stoped_humi"] = m_disinfectionCtrlService->m_context.stoped_humi; |
|
|
|
receipt["disinfectionConfig"]["continued_humi"] = m_disinfectionCtrlService->m_context.continued_humi; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
HttpResponsePtr MainControlService::hello_world( //
|
|
|
|
HttpRequestPtr request, shared_ptr<RestfulServer::Context> context, std::shared_ptr<ConnectionState>) { |
|
|
|
return std::make_shared<HttpResponse>(200, "OK", HttpErrorCode::Ok, WebSocketHttpHeaders(), "hello_world"); |
|
|
|
} |
|
|
|
|
|
|
|
HttpResponsePtr MainControlService::doscript(HttpRequestPtr httpreq, shared_ptr<RestfulServer::Context> context, std::shared_ptr<ConnectionState> conn) { |
|
|
|
// logger->info("do\n{}", httpreq->body);
|
|
|
|
// if (m_a8000_script_processer->isWorking()) {
|
|
|
|
// return std::make_shared<HttpResponse>(200, "FAIL", HttpErrorCode::Ok, WebSocketHttpHeaders(), "do script fail, script processer is running");
|
|
|
|
// }
|
|
|
|
// m_a8000_script_processer->executeScript(httpreq->body);
|
|
|
|
return std::make_shared<HttpResponse>(200, "OK", HttpErrorCode::Ok, WebSocketHttpHeaders(), "do script success"); |
|
|
|
} |
|
|
|
|
|
|
|
HttpResponsePtr MainControlService::stopscript(HttpRequestPtr, shared_ptr<RestfulServer::Context>, std::shared_ptr<ConnectionState>) { |
|
|
|
// m_a8000_script_processer->stopScript();
|
|
|
|
return std::make_shared<HttpResponse>(200, "OK", HttpErrorCode::Ok, WebSocketHttpHeaders(), "stop script success"); |
|
|
|
} |