临时保存

This commit is contained in:
cpdl
2025-04-30 17:36:24 +08:00
parent 7ed7033716
commit 43515d8058
60 changed files with 29146 additions and 67 deletions

View File

@@ -0,0 +1,65 @@
// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.
#include "FLTService.h"
#include "../FLTConvert.h"
std::string FLTService::getServiceName() const { return m_serviceName; }
void notifyEvent(const std::string& eventName,
flutter::EncodableMap& arguments) {
arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
flutter::EncodableValue("")));
std::string strLog;
strLog.append("en: ")
.append(eventName)
.append(", args: ")
.append(Convert::getInstance()->getStringFormMapForLog(&arguments));
std::list<std::string> logList;
Convert::getInstance()->getLogList(strLog, logList);
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
}
//void FLTService::notifyEvent(const std::string& eventName,
// flutter::EncodableMap& arguments,
// const NimCore::InvokeMehtodCallback& callback) {
// arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
// flutter::EncodableValue(m_serviceName)));
// std::string strLog;
// strLog.append("en: ")
// .append(eventName)
// .append(", args: ")
// .append(Convert::getInstance()->getStringFormMapForLog(&arguments));
// std::list<std::string> logList;
// Convert::getInstance()->getLogList(strLog, logList);
// for (auto& it : logList) {
// YXLOG_API(Info) << it << YXLOGEnd;
// }
// NimCore::getInstance()->invokeMethod(eventName, arguments, callback);
// YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
//}
void FLTService::notifyEventEx(const std::string& serviceName,
const std::string& eventName,
flutter::EncodableMap& arguments) {
arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
flutter::EncodableValue(serviceName)));
std::string strLog;
strLog.append("en: ")
.append(eventName)
.append(", args: ")
.append(Convert::getInstance()->getStringFormMapForLog(&arguments));
std::list<std::string> logList;
Convert::getInstance()->getLogList(strLog, logList);
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEventEx invoke completation." << YXLOGEnd;
}