From 0cf743a8503f02348f62061e8e13f59ba347d74c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 20 Aug 2024 15:56:40 +0800 Subject: [PATCH] update --- appsrc/baseservice/front_msg_processer/front_msg_processer.cpp | 6 +++--- appsrc/baseservice/front_msg_processer/front_msg_processer.hpp | 6 +++--- .../iflytop_front_end_service/iflytop_front_end_service.cpp | 6 +++--- .../iflytop_front_end_service/iflytop_front_end_service.hpp | 2 +- appsrc/service/app/add_liquid_service.cpp | 8 ++++---- appsrc/service/app/air_leak_detect_test.cpp | 8 ++++---- appsrc/service/app/disinfection_ctrl_service_ext.cpp | 6 +++--- appsrc/service/app/drain_liquid_service.cpp | 8 ++++---- appsrc/service/app/pipeline_pressure_control.cpp | 10 +++++----- appsrc/service/app_core.cpp | 6 +++--- appsrc/service/audit_mgr_service.cpp | 2 +- appsrc/service/device_info_mgr_service.cpp | 2 +- appsrc/service/disinfection_logs_service.cpp | 4 ++-- appsrc/service/front_end_realtime_display_content_mgr.cpp | 4 ++-- appsrc/service/hardware/device_io_ctrl_service.cpp | 2 +- appsrc/service/setting_mgr_service.cpp | 8 ++++---- appsrc/service/test_page_mgr_service.cpp | 4 ++-- appsrc/service/user_mgr_service.cpp | 8 ++++---- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp b/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp index a3e0f73..f2adabe 100644 --- a/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp +++ b/appsrc/baseservice/front_msg_processer/front_msg_processer.cpp @@ -75,7 +75,7 @@ void FrontMsgProcesser::processMsg(shared_ptr cxt) { if (fn == "FNScheduler.geFnList") { cxt->receipt["ackcode"] = 0; - cxt->receipt["content"] = geFnList(); + cxt->receipt["rely"] = geFnList(); return; } @@ -90,8 +90,8 @@ void FrontMsgProcesser::processMsg(shared_ptr cxt) { if (int(cxt->receipt["ackcode"]) != 0) { cxt->receipt["message"] = fmt::format("[{}],{}", ecode2str(cxt->receipt["ackcode"]), cxt->ackcodeExtMessage); } - if (cxt->content.empty() == false) { - cxt->receipt["content"] = cxt->content; + if (cxt->rely.empty() == false) { + cxt->receipt["rely"] = cxt->rely; } } catch (const appexception& e) { diff --git a/appsrc/baseservice/front_msg_processer/front_msg_processer.hpp b/appsrc/baseservice/front_msg_processer/front_msg_processer.hpp index 79befbe..60d2b14 100644 --- a/appsrc/baseservice/front_msg_processer/front_msg_processer.hpp +++ b/appsrc/baseservice/front_msg_processer/front_msg_processer.hpp @@ -38,7 +38,7 @@ class MsgProcessContext { json params; json receipt; int ackcode = 0; - json content; + json rely; string ackcodeExtMessage; }; @@ -169,14 +169,14 @@ static inline T jsonGet(json j) { function __fun; \ FrontMsgProcesser::ins().regProcesser(__fun, thisClass.className, #fn, {MARCO_LIST(REGFNV_EACH_EXPTR2, _1, _2, _3, _4, _5, __VA_ARGS__)}, [this](shared_ptr cxt) { \ json& params = cxt->params; \ - cxt->content = fn(MARCO_LIST(REGFNV_EACH_EXPTR1, _1, _2, _3, _4, _5, __VA_ARGS__)); \ + cxt->rely = fn(MARCO_LIST(REGFNV_EACH_EXPTR1, _1, _2, _3, _4, _5, __VA_ARGS__)); \ }); \ } #define REG_FN_VOID(fn, type) \ { \ function __fun; \ - FrontMsgProcesser::ins().regProcesser(__fun, thisClass.className, #fn, {}, [this](shared_ptr cxt) { cxt->content = fn(); }); \ + FrontMsgProcesser::ins().regProcesser(__fun, thisClass.className, #fn, {}, [this](shared_ptr cxt) { cxt->rely = fn(); }); \ } #define REG_EXTFN(fn, type, ...) \ diff --git a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp index 976f46b..3643dc6 100644 --- a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp +++ b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.cpp @@ -90,17 +90,17 @@ void IflytopFrontEndService::sendReport(json reportType, json report) { } } -void IflytopFrontEndService::sendClassReport(string fromclass, string fromfn, const json& content) { +void IflytopFrontEndService::sendClassReport(string fromclass, string fromfn, const json& rely) { json report; report["fromClass"] = fromclass; report["fromFn"] = fromfn; - report["content"] = content; + report["rely"] = rely; sendReport("classReport", report); } void IflytopFrontEndService::sendPrompt(string message) { json report; - report["content"]["message"] = message; + report["rely"]["message"] = message; sendReport("prompt", report); } diff --git a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.hpp b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.hpp index 3dc1bc0..2bf6a02 100644 --- a/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.hpp +++ b/appsrc/baseservice/iflytop_front_end_service/iflytop_front_end_service.hpp @@ -54,7 +54,7 @@ class IflytopFrontEndService : public enable_shared_from_this cxt, int stopatg) { start(stopatg); } void AddLiquidService::stop(shared_ptr cxt) { stop(); } void AddLiquidService::getState(shared_ptr cxt) { // - cxt->content["workState"] = state2str(getWorkstate()); - cxt->content["workStateDisplay"] = state2chstr(getWorkstate()); - cxt->content["nowLiquid"] = m_dwus->getWeight(); + cxt->rely["workState"] = state2str(getWorkstate()); + cxt->rely["workStateDisplay"] = state2chstr(getWorkstate()); + cxt->rely["nowLiquid"] = m_dwus->getWeight(); } void AddLiquidService::getServiceConfig(shared_ptr cxt) { json cfg; cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity(); cfg["show"] = true; cfg["updatePeriod"] = 300; - cxt->content = cfg; + cxt->rely = cfg; } diff --git a/appsrc/service/app/air_leak_detect_test.cpp b/appsrc/service/app/air_leak_detect_test.cpp index 6084885..877f14a 100644 --- a/appsrc/service/app/air_leak_detect_test.cpp +++ b/appsrc/service/app/air_leak_detect_test.cpp @@ -93,9 +93,9 @@ void AirLeakDetectTest::stop(shared_ptr cxt) { stop(); } void AirLeakDetectTest::getState(shared_ptr cxt) { // if (PORT.isPipeDM()) { - cxt->content["workState"] = state2str(getWorkstate()); - cxt->content["workStateDisplay"] = state2chstr(getWorkstate()); - cxt->content["pressure"] = pressurePa / 1000.0; + cxt->rely["workState"] = state2str(getWorkstate()); + cxt->rely["workStateDisplay"] = state2chstr(getWorkstate()); + cxt->rely["pressure"] = pressurePa / 1000.0; } } void AirLeakDetectTest::getServiceConfig(shared_ptr cxt) { @@ -105,6 +105,6 @@ void AirLeakDetectTest::getServiceConfig(shared_ptr cxt) { cfg["pressureMax"] = 8.0; cfg["show"] = true; cfg["updatePeriod"] = 300; - cxt->content = cfg; + cxt->rely = cfg; } } \ No newline at end of file diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.cpp b/appsrc/service/app/disinfection_ctrl_service_ext.cpp index 92ee790..2e828ca 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.cpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.cpp @@ -63,7 +63,7 @@ void DisinfectionCtrlServiceExt::startWithFormula(shared_ptr void DisinfectionCtrlServiceExt::stop(shared_ptr cxt) { dcs->stop(); } void DisinfectionCtrlServiceExt::getRealtimeConfig(shared_ptr cxt) { - json& rely = cxt->content; + json& rely = cxt->rely; for (auto& cfg : dcs->getRealtimeCfg()) { rely[cfg.first] = cfg.second; } @@ -74,7 +74,7 @@ void DisinfectionCtrlServiceExt::setRealtimeConfig(shared_ptr } void DisinfectionCtrlServiceExt::getState(shared_ptr cxt) { - json& rely = cxt->content; + json& rely = cxt->rely; rely["statedisplayName"] = toDisplayName(string(dcs->getState())); rely["state"] = string(dcs->getState()); rely["curStateRemainTimeS"] = dcs->getCurStateRemainTimeS(); @@ -97,7 +97,7 @@ void DisinfectionCtrlServiceExt::getState(shared_ptr cxt) { } void DisinfectionCtrlServiceExt::getServiceConfig(shared_ptr cxt) { - json& rely = cxt->content; + json& rely = cxt->rely; rely["curveNum"] = PORT.getExtH2O2SensorNum() + 1; rely["curveUpdatePeriodMs"] = 10000; } diff --git a/appsrc/service/app/drain_liquid_service.cpp b/appsrc/service/app/drain_liquid_service.cpp index 1f7ec9d..3dec946 100644 --- a/appsrc/service/app/drain_liquid_service.cpp +++ b/appsrc/service/app/drain_liquid_service.cpp @@ -63,9 +63,9 @@ void DrainLiquidService::start(shared_ptr cxt) { // } void DrainLiquidService::stop(shared_ptr cxt) { stop(); } void DrainLiquidService::getState(shared_ptr cxt) { // - cxt->content["workState"] = state2str(getWorkstate()); - cxt->content["workStateDisplay"] = state2chstr(getWorkstate()); - cxt->content["nowLiquid"] = m_dwus->getWeight(); + cxt->rely["workState"] = state2str(getWorkstate()); + cxt->rely["workStateDisplay"] = state2chstr(getWorkstate()); + cxt->rely["nowLiquid"] = m_dwus->getWeight(); } void DrainLiquidService::getServiceConfig(shared_ptr cxt) { @@ -73,7 +73,7 @@ void DrainLiquidService::getServiceConfig(shared_ptr cxt) { cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity(); cfg["show"] = true; cfg["updatePeriod"] = 300; - cxt->content = cfg; + cxt->rely = cfg; } void DrainLiquidService::workThread() { diff --git a/appsrc/service/app/pipeline_pressure_control.cpp b/appsrc/service/app/pipeline_pressure_control.cpp index eb1d091..1387d3c 100644 --- a/appsrc/service/app/pipeline_pressure_control.cpp +++ b/appsrc/service/app/pipeline_pressure_control.cpp @@ -53,7 +53,7 @@ void PipelinePressureControl::getConfig(shared_ptr cxt) { cfg["intensitys"]["constantPressure"] = {}; cfg["intensitys"]["positivePressure"] = {"10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"}; cfg["intensitys"]["negativePressure"] = {"10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"}; - cxt->content = cfg; + cxt->rely = cfg; } void PipelinePressureControl::setType(shared_ptr cxt, string type) { m_type = cxt->params["type"]; @@ -73,8 +73,8 @@ void PipelinePressureControl::setType(shared_ptr cxt, string } syncPressureValueState(); - cxt->content["type"] = m_type; - cxt->content["intensity"] = fmt::format("{}%", m_intensity); + cxt->rely["type"] = m_type; + cxt->rely["intensity"] = fmt::format("{}%", m_intensity); } void PipelinePressureControl::setIntensity(shared_ptr cxt, string intensity) { @@ -89,7 +89,7 @@ void PipelinePressureControl::setIntensity(shared_ptr cxt, st syncPressureValueState(); } void PipelinePressureControl::getState(shared_ptr cxt) { - cxt->content["type"] = m_type; - cxt->content["intensity"] = fmt::format("{}%", m_intensity); + cxt->rely["type"] = m_type; + cxt->rely["intensity"] = fmt::format("{}%", m_intensity); ; } diff --git a/appsrc/service/app_core.cpp b/appsrc/service/app_core.cpp index 80c2f86..91cf667 100644 --- a/appsrc/service/app_core.cpp +++ b/appsrc/service/app_core.cpp @@ -140,7 +140,7 @@ int AppCore::demofn(int a, int b) { return 0; } void AppCore::getState(shared_ptr cxt) { lock_guard lock(warningPromptListMutex); - cxt->content = getState(); + cxt->rely = getState(); } void AppCore::promptConfirm(shared_ptr cxt, string promptId) { @@ -156,7 +156,7 @@ void AppCore::promptConfirm(shared_ptr cxt, string promptId) void AppCore::promptGetAll(shared_ptr cxt) { lock_guard lock(warningPromptListMutex); - auto content = cxt->content; + auto content = cxt->rely; content["prompts"] = json::array(); for (auto& p : warningPromptList) { content["warningPromptList"].push_back(*p); @@ -165,7 +165,7 @@ void AppCore::promptGetAll(shared_ptr cxt) { void AppCore::promptGetNext(shared_ptr cxt) { lock_guard lock(warningPromptListMutex); - auto content = cxt->content; + auto content = cxt->rely; if (warningPromptList.size() > 0) { content["warningPrompt"] = *warningPromptList.front(); } diff --git a/appsrc/service/audit_mgr_service.cpp b/appsrc/service/audit_mgr_service.cpp index f09d50b..33e44b2 100644 --- a/appsrc/service/audit_mgr_service.cpp +++ b/appsrc/service/audit_mgr_service.cpp @@ -86,7 +86,7 @@ void AuditMgrService::exportData(shared_ptr cxt) { void AuditMgrService::getRecords(shared_ptr cxt) { json& params = cxt->params; - cxt->content = m_db->getUserBehaviorRecordDescJson(jsonGet(params["page"]), jsonGet(params["page_size"])); + cxt->rely = m_db->getUserBehaviorRecordDescJson(jsonGet(params["page"]), jsonGet(params["page_size"])); } void AuditMgrService::pushTestData(shared_ptr cxt) { ADD_USER_BEHAVIOR("123", kbehavior_login, ""); diff --git a/appsrc/service/device_info_mgr_service.cpp b/appsrc/service/device_info_mgr_service.cpp index ea30c22..765296b 100644 --- a/appsrc/service/device_info_mgr_service.cpp +++ b/appsrc/service/device_info_mgr_service.cpp @@ -15,7 +15,7 @@ void DeviceInfoMgrService::initialize() { void DeviceInfoMgrService::getDeviceInfo(shared_ptr cxt) { // - auto& content = cxt->content; + auto& content = cxt->rely; content["projectType"] = PORT.getProjTypeString(); content["appVersion"] = VERSION; content["mircoVersion"] = "3.0.0"; // TODO:换成真实的版本信息 diff --git a/appsrc/service/disinfection_logs_service.cpp b/appsrc/service/disinfection_logs_service.cpp index 488ab86..a08cf1c 100644 --- a/appsrc/service/disinfection_logs_service.cpp +++ b/appsrc/service/disinfection_logs_service.cpp @@ -558,7 +558,7 @@ void DisinfectionLogsService::getRecordList(shared_ptr cxt) { */ vector record; for (auto& file : m_recordFiles) record.push_back(file); - cxt->content = record; + cxt->rely = record; return; } void DisinfectionLogsService::getRecord(shared_ptr cxt) { @@ -567,7 +567,7 @@ void DisinfectionLogsService::getRecord(shared_ptr cxt) { vector lines; split(content, lines, '\n'); for (auto& line : lines) { - cxt->content.push_back(line); + cxt->rely.push_back(line); } } diff --git a/appsrc/service/front_end_realtime_display_content_mgr.cpp b/appsrc/service/front_end_realtime_display_content_mgr.cpp index ff9feec..366e8c9 100644 --- a/appsrc/service/front_end_realtime_display_content_mgr.cpp +++ b/appsrc/service/front_end_realtime_display_content_mgr.cpp @@ -8,7 +8,7 @@ void FrontEndRealtimeDisplayContentMgr::initialize() { // } void FrontEndRealtimeDisplayContentMgr::readH2O2SensorData(shared_ptr cxt) { - auto& content = cxt->content; + auto& content = cxt->rely; auto h2o2Mgr = GET_SERVICE(DeviceIoControlService)->getH2O2SensorMgr(); @@ -35,5 +35,5 @@ void FrontEndRealtimeDisplayContentMgr::readH2O2SensorData(shared_ptrisDataExpired(2) ? h2o2Mgr->getCacheData(2)->saturation : -1; } - cxt->content["val"] = sensordata; + cxt->rely["val"] = sensordata; } \ No newline at end of file diff --git a/appsrc/service/hardware/device_io_ctrl_service.cpp b/appsrc/service/hardware/device_io_ctrl_service.cpp index d37a685..8f5adf7 100644 --- a/appsrc/service/hardware/device_io_ctrl_service.cpp +++ b/appsrc/service/hardware/device_io_ctrl_service.cpp @@ -473,7 +473,7 @@ int DeviceIoControlService::AddLiquidPumpPostPS_readPa() { // #define PROCESS_CMD_WITH_RET(fnName, ...) \ if (testFnName == #fnName) { \ auto ret = fnName(__VA_ARGS__); \ - cxt->content = ret; \ + cxt->rely = ret; \ return; \ } diff --git a/appsrc/service/setting_mgr_service.cpp b/appsrc/service/setting_mgr_service.cpp index 733ef39..369ddee 100644 --- a/appsrc/service/setting_mgr_service.cpp +++ b/appsrc/service/setting_mgr_service.cpp @@ -24,17 +24,17 @@ void SettingMgrService::initialize() { void SettingMgrService::getAllSetting(shared_ptr cxt) { auto settings = SETTING_DB->getAllSetting(); - cxt->content = settings; + cxt->rely = settings; } void SettingMgrService::setSettingVal(shared_ptr cxt, string settingName, string settingVal) { bool suc = SETTING_DB->setSettingVal(settingName, settingVal); APPCHECK(suc, err::kappe_db_operate_error, "setSettingVal failed"); } -void SettingMgrService::getAllFormula(shared_ptr cxt) { cxt->content = FORMULA_DB->getAllFormula(); } +void SettingMgrService::getAllFormula(shared_ptr cxt) { cxt->rely = FORMULA_DB->getAllFormula(); } void SettingMgrService::addNewFormula(shared_ptr cxt) { auto formula = FORMULA_DB->newFormula(); - cxt->content = formula; + cxt->rely = formula; } void SettingMgrService::delFormula(shared_ptr cxt, string formula_id) { @@ -54,5 +54,5 @@ void SettingMgrService::updateFormulaIterm(shared_ptr cxt, st } void SettingMgrService::factoryResetSettings(shared_ptr cxt) { SETTING_DB->factoryReset(); - cxt->content = SETTING_DB->getAllSetting(); + cxt->rely = SETTING_DB->getAllSetting(); } diff --git a/appsrc/service/test_page_mgr_service.cpp b/appsrc/service/test_page_mgr_service.cpp index bf9627e..3453d93 100644 --- a/appsrc/service/test_page_mgr_service.cpp +++ b/appsrc/service/test_page_mgr_service.cpp @@ -1,9 +1,9 @@ #include "test_page_mgr_service.hpp" using namespace iflytop; -void TestPageMgrService::getTestPageCfgInfo(shared_ptr cxt) { cxt->content["items"] = m_testPageItemMgr.getPageCfgInfo(); } +void TestPageMgrService::getTestPageCfgInfo(shared_ptr cxt) { cxt->rely["items"] = m_testPageItemMgr.getPageCfgInfo(); } void TestPageMgrService::onButton(shared_ptr cxt) { m_testPageItemMgr.processOnButton(cxt->params); } -void TestPageMgrService::readState(shared_ptr cxt) { cxt->content = m_testPageItemMgr.readState(); } +void TestPageMgrService::readState(shared_ptr cxt) { cxt->rely = m_testPageItemMgr.readState(); } void TestPageMgrService::triggerOnePrompt(shared_ptr cxt) { GET_SERVICE(IflytopFrontEndService)->sendPrompt("测试Prompt"); } void TestPageMgrService::startReportState(shared_ptr cxt) { m_testPageItemMgr.startReportState(1000); } void TestPageMgrService::stopReportState(shared_ptr cxt) { m_testPageItemMgr.stopReportState(); } diff --git a/appsrc/service/user_mgr_service.cpp b/appsrc/service/user_mgr_service.cpp index e8ca9fb..35f56ff 100644 --- a/appsrc/service/user_mgr_service.cpp +++ b/appsrc/service/user_mgr_service.cpp @@ -67,7 +67,7 @@ void UserMgrService::updateUserUid(shared_ptr cxt, int id, st } void UserMgrService::getAllUser(shared_ptr cxt) { auto users = m_db->getAllUserJson(); - cxt->receipt["content"] = users; + cxt->receipt["rely"] = users; return; } @@ -75,11 +75,11 @@ void UserMgrService::getLoginUser(shared_ptr cxt) { string loginuid = m_deviceStateService->getLoginUid(); bool isLogin = m_deviceStateService->isLogin(); - cxt->receipt["content"]["isLogin"] = isLogin; + cxt->receipt["rely"]["isLogin"] = isLogin; if (isLogin) { - cxt->receipt["content"]["loginUser"] = m_db->getUserJson(loginuid); + cxt->receipt["rely"]["loginUser"] = m_db->getUserJson(loginuid); } else { - cxt->receipt["content"]["loginUser"] = {}; + cxt->receipt["rely"]["loginUser"] = {}; } return; }