From ca0842764ece4052d0ac09fd02a04ff0da6666df Mon Sep 17 00:00:00 2001 From: zuojiangjiang Date: Tue, 4 Apr 2023 17:25:07 +0800 Subject: [PATCH] fix code Signed-off-by: zuojiangjiang --- .../framework/cloud/auto_cache.cpp | 2 +- .../framework/cloud/cloud_info.cpp | 20 ++- .../framework/include/cloud/cloud_info.h | 3 +- relational_store/CMakeLists.txt | 3 + .../cloud_data/include/cloud_manager_impl.h | 51 ++++++++ .../cloud_data/include/cloud_service_proxy.h | 39 ++++++ .../cloud_data/include/icloud_service.h | 37 ++++++ .../native/cloud_data/src/cloud_manager.cpp | 24 ++++ .../cloud_data/src/cloud_manager_impl.cpp | 122 ++++++++++++++++++ .../cloud_data/src/cloud_service_proxy.cpp | 105 +++++++++++++++ .../cloud_data/include/cloud_manager.h | 33 +++++ .../cloud_data/include/cloud_service.h | 8 ++ 12 files changed, 440 insertions(+), 7 deletions(-) create mode 100644 relational_store/frameworks/native/cloud_data/include/cloud_manager_impl.h create mode 100644 relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h create mode 100644 relational_store/frameworks/native/cloud_data/include/icloud_service.h create mode 100644 relational_store/frameworks/native/cloud_data/src/cloud_manager.cpp create mode 100644 relational_store/frameworks/native/cloud_data/src/cloud_manager_impl.cpp create mode 100644 relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp create mode 100644 relational_store/interfaces/inner_api/cloud_data/include/cloud_manager.h diff --git a/datamgr_service/services/distributeddataservice/framework/cloud/auto_cache.cpp b/datamgr_service/services/distributeddataservice/framework/cloud/auto_cache.cpp index c080d640..1b202c42 100644 --- a/datamgr_service/services/distributeddataservice/framework/cloud/auto_cache.cpp +++ b/datamgr_service/services/distributeddataservice/framework/cloud/auto_cache.cpp @@ -13,5 +13,5 @@ * limitations under the License. */ -#include "store_auto_cache.h" +#include "store/auto_cache.h" diff --git a/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp b/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp index 17d7b1f1..d8080306 100644 --- a/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp +++ b/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp @@ -14,6 +14,8 @@ */ #include "cloud/cloud_info.h" +#include "utils/constant.h" + namespace OHOS::DistributedData { bool CloudInfo::Marshal(Serializable::json &node) const { @@ -57,14 +59,22 @@ bool CloudInfo::AppInfo::Unmarshal(const Serializable::json &node) std::string CloudInfo::GetKey() const { - return std::string(); + return GetKey(INFO_PREFIX, { id, std::to_string(user) }); } -std::map CloudInfo::GetSchemaKey() const +std::vector CloudInfo::GetSchemaKey() const { - for (auto &app : apps) { - + std::vector keys; + keys.reserve(apps.size()); + for (const auto &app : apps) { + const auto key = GetKey(SCHEMA_PREFIX, { id, std::to_string(user), app.bundleName }); + keys.push_back(key); } - return std::map(); + return keys; +} + +std::string CloudInfo::GetKey(const std::string &prefix, const std::initializer_list &fields) const +{ + return Constant::Join(prefix, Constant::KEY_SEPARATOR, fields); } } // namespace OHOS::DistributedData \ No newline at end of file diff --git a/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h b/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h index 22f37cbb..b9bee281 100644 --- a/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h +++ b/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h @@ -36,7 +36,8 @@ public: std::vector apps; std::string GetKey() const; - std::map GetSchemaKey() const; + std::vector GetSchemaKey() const; + std::string GetKey(const std::string &prefix, const std::initializer_list &fields) const; bool Marshal(json &node) const override; bool Unmarshal(const json &node) override; diff --git a/relational_store/CMakeLists.txt b/relational_store/CMakeLists.txt index 559ae0fd..ab7ad9b0 100644 --- a/relational_store/CMakeLists.txt +++ b/relational_store/CMakeLists.txt @@ -12,6 +12,7 @@ set(MOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../mock) set(KV_STORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../kv_store) add_definitions(-DNAPI_EXPERIMENTAL) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/appdatafwk/src relational_store_src) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/cloud_data/src relational_store_src) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/dataability/src relational_store_src) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb/src relational_store_src) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_data_ability_adapter/src relational_store_src) @@ -19,11 +20,13 @@ aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_data_shar aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/src relational_store_src) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataability/src relational_store_src) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/rdb/src relational_store_src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/cloud_data/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataability/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/rdb/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/appdatafwk/include) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/cloud_data/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/dataability/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb_data_ability_adapter/include) diff --git a/relational_store/frameworks/native/cloud_data/include/cloud_manager_impl.h b/relational_store/frameworks/native/cloud_data/include/cloud_manager_impl.h new file mode 100644 index 00000000..2c8501ee --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/include/cloud_manager_impl.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_IMPL_H +#define OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_IMPL_H + +#include +#include "cloud_service.h" +#include "cloud_service_proxy.h" +#include "icloud_service.h" +#include "iremote_object.h" +#include "iremote_proxy.h" + +namespace OHOS::CloudData { +class CloudDataServiceProxy; +class CloudManagerImpl { +public: + static CloudManagerImpl &GetInstance(); + std::shared_ptr GetCloudService(); + +private: + CloudManagerImpl() = default; + ~CloudManagerImpl() = default; + static std::shared_ptr GetDistributedDataManager(); + sptr GetCloudServiceProxy(); + + std::shared_ptr distributedDataMgr_; + std::mutex mutex_; + std::shared_ptr cloudService_; +}; + +class CloudDataServiceProxy : public IRemoteProxy { +public: + explicit CloudDataServiceProxy(const sptr &impl); + ~CloudDataServiceProxy() = default; + sptr GetFeatureInterface(const std::string &name) override; +}; +} // namespace OHOS::CloudData +#endif // OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_IMPL_H diff --git a/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h b/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h new file mode 100644 index 00000000..8ece3de8 --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_SERVICE_PROXY_H +#define OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_SERVICE_PROXY_H + +#include "icloud_service.h" +#include "iremote_object.h"" +#include "iremote_proxy.h" + +namespace OHOS::CloudData { +class CloudServiceProxy: public IRemoteProxy { +public: + explicit CloudServiceProxy(const sptr& object); + virtual ~CloudServiceProxy() = default; + int32_t EnableCloud(const std::string &id, const std::map &switches) override; + int32_t DisableCloud(const std::string &id) override; + int32_t ChangeAppSwitch(const std::string &id, const std::string &bundleName, int32_t appSwitch) override; + int32_t Clean(const std::string &id, const std::map &actions) override; + int32_t NotifyDataChange(const std::string &id, const std::string &bundleName) override; + +private: + sptr remote_; + static inline BrokerDelegator delegator_; +}; +} // namespace OHOS::CloudData +#endif // OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_SERVICE_PROXY_H diff --git a/relational_store/frameworks/native/cloud_data/include/icloud_service.h b/relational_store/frameworks/native/cloud_data/include/icloud_service.h new file mode 100644 index 00000000..a21def4f --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/include/icloud_service.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DISTRIBUTED_DATA_CLOUD_ICLOUD_SERVICE_H +#define OHOS_DISTRIBUTED_DATA_CLOUD_ICLOUD_SERVICE_H + +#include "cloud_service.h" +#include "iremote_broker.h" + +namespace OHOS::CloudData { +class ICloudService : public CloudService, public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.CloudData.CloudServer"); +}; + +class IKvStoreDataService : public IRemoteBroker { +public: + enum { GET_FEATURE_INTERFACE = 0 }; + + virtual sptr GetFeatureInterface(const std::string &name) = 0; + + DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DistributedKv.IKvStoreDataService"); +}; +} // namespace OHOS::CloudData +#endif // OHOS_DISTRIBUTED_DATA_CLOUD_ICLOUD_SERVICE_H diff --git a/relational_store/frameworks/native/cloud_data/src/cloud_manager.cpp b/relational_store/frameworks/native/cloud_data/src/cloud_manager.cpp new file mode 100644 index 00000000..c9a921c9 --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/src/cloud_manager.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "cloud_manager.h" +#include "cloud_manager_impl.h" + +namespace OHOS::CloudData { +std::shared_ptr CloudManager::GetCloudService() +{ + return CloudManagerImpl::GetInstance().GetCloudService(); +} +} // namespace OHOS::CloudData \ No newline at end of file diff --git a/relational_store/frameworks/native/cloud_data/src/cloud_manager_impl.cpp b/relational_store/frameworks/native/cloud_data/src/cloud_manager_impl.cpp new file mode 100644 index 00000000..f74edb1d --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/src/cloud_manager_impl.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "CloudManagerImpl" + +#include "cloud_manager_impl.h" +#include "itypes_util.h" +#include "iservice_registry.h" +#include "log_print.h" +#include "system_ability_definition.h" + +namespace OHOS::CloudData { +CloudManagerImpl &CloudManagerImpl::GetInstance() +{ + static CloudManagerImpl instance; + return instance; +} + +std::shared_ptr CloudManagerImpl::GetCloudService() +{ + std::lock_guard lg(mutex_); + if (cloudService_ != nullptr) { + return cloudService_; + } + auto proxy = GetCloudServiceProxy(); + if (proxy == nullptr) { + return nullptr; + } + cloudService_ = std::shared_ptr(proxy.GetRefPtr(), [holder = proxy] (const auto*) {}); + if (cloudService_ == nullptr) { + return nullptr; + } + return cloudService_; +} + +sptr CloudManagerImpl::GetCloudServiceProxy() +{ + if (distributedDataMgr_ == nullptr) { + distributedDataMgr_ = GetDistributedDataManager(); + } + if (distributedDataMgr_ == nullptr) { + ZLOGE("get distributed data manager failed"); + return nullptr; + } + + auto remote = distributedDataMgr_->GetFeatureInterface(CloudService::SERVICE_NAME); + if (remote == nullptr) { + ZLOGE("get cloud service failed"); + return nullptr; + } + return iface_cast(remote); +} + +CloudDataServiceProxy::CloudDataServiceProxy(const sptr &impl) + : IRemoteProxy(impl) +{ + ZLOGI("init proxy"); +} + +std::shared_ptr CloudManagerImpl::GetDistributedDataManager() +{ + auto abilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (abilityMgr == nullptr) { + ZLOGE("get system ability manager failed"); + return nullptr; + } + auto remoteObject = abilityMgr->CheckSystemAbility(DISTRIBUTED_KV_DATA_SERVICE_ABILITY_ID); + if (remoteObject == nullptr) { + ZLOGE("get distributed data manager failed"); + return nullptr; + } + sptr proxy = new(std::nothrow) CloudDataServiceProxy(remoteObject); + if (proxy == nullptr) { + ZLOGE("new CloudDataServiceProxy failed"); + return nullptr; + } + return std::shared_ptr(proxy.GetRefPtr(), + [holder = proxy](const auto *) {}); +} + +sptr CloudDataServiceProxy::GetFeatureInterface(const std::string &name) +{ + ZLOGI("%s", name.c_str()); + MessageParcel data; + if (!data.WriteInterfaceToken(CloudDataServiceProxy::GetDescriptor())) { + ZLOGE("write descriptor failed"); + return nullptr; + } + + if (!ITypesUtil::Marshal(data, name)) { + ZLOGE("write descriptor failed"); + return nullptr; + } + + MessageParcel reply; + MessageOption mo { MessageOption::TF_SYNC }; + int32_t error = Remote()->SendRequest(GET_FEATURE_INTERFACE, data, reply, mo); + if (error != 0) { + ZLOGE("SendRequest returned %{public}d", error); + return nullptr; + } + + sptr remoteObject; + if (!ITypesUtil::Unmarshal(reply, remoteObject)) { + ZLOGE("remote object is nullptr"); + return nullptr; + } + return remoteObject; +} +} // namespace OHOS::CloudData \ No newline at end of file diff --git a/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp b/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp new file mode 100644 index 00000000..fd295595 --- /dev/null +++ b/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "CloudServiceProxy" + +#include "cloud_service_proxy.h" +#include "itypes_util.h" +#include "log_print.h" + +namespace OHOS::CloudData { +#define IPC_SEND(code, reply, ...) \ +({ \ + int32_t __status = SUCCESS; \ + do { \ + MessageParcel request; \ + if (!request.WriteInterfaceToken(GetDescriptor())) { \ + __status = IPC_PARCEL_ERROR; \ + break; \ + } \ + if (!ITypesUtil::Marshal(request, ##__VA_ARGS__)) { \ + __status = IPC_PARCEL_ERROR; \ + break; \ + } \ + MessageOption option; \ + auto result = remote_->SendRequest((code), request, reply, option); \ + if (result != 0) { \ + __status = IPC_ERROR; \ + break; \ + } \ + \ + ITypesUtil::Unmarshal(reply, __status); \ + } while (0); \ + __status; \ +}) + +CloudServiceProxy::CloudServiceProxy(const sptr &object) + : IRemoteProxy(object) +{ + remote_ = Remote(); +} + +int32_t CloudServiceProxy::EnableCloud(const std::string &id, const std::map &switches) +{ + MessageParcel reply; + int32_t status = IPC_SEND(TRANS_ENABLE_CLOUD, reply, id, switches); + if (status != SUCCESS) { + ZLOGE("status:0x%{public}x id:%{public}.6s size:%{public}zu", status, id.c_str(), switches.size()); + } + return static_cast(status); +} + +int32_t CloudServiceProxy::DisableCloud(const std::string &id) +{ + MessageParcel reply; + int32_t status = IPC_SEND(TRANS_DISABLE_CLOUD, reply, id); + if (status != SUCCESS) { + ZLOGE("status:0x%{public}x id:%{public}.6s", status, id.c_str()); + } + return static_cast(status); +} + +int32_t CloudServiceProxy::ChangeAppSwitch(const std::string &id, const std::string &bundleName, int32_t appSwitch) +{ + MessageParcel reply; + int32_t status = IPC_SEND(TRANS_CHANGE_APP_SWITCH, reply, id, bundleName, appSwitch); + if (status != SUCCESS) { + ZLOGE("status:0x%{public}x id:%{public}.6s bundleName:%{public}s switch:%{public}d", + status, id.c_str(), bundleName.c_str(), appSwitch); + } + return static_cast(status); +} + +int32_t CloudServiceProxy::Clean(const std::string &id, const std::map &actions) +{ + MessageParcel reply; + int32_t status = IPC_SEND(TRANS_CLEAN, reply, id, actions); + if (status != SUCCESS) { + ZLOGE("status:0x%{public}x id:%{public}.6s size:%{public}zu", status, id.c_str(), actions.size()); + } + return static_cast(status); + +} + +int32_t CloudServiceProxy::NotifyDataChange(const std::string &id, const std::string &bundleName) +{ + MessageParcel reply; + int32_t status = IPC_SEND(TRANS_NOTIFY_DATA_CHANGE, reply, id, bundleName); + if (status != SUCCESS) { + ZLOGE("status:0x%{public}x id:%{public}.6s bundleName:%{public}s", status, id.c_str(), bundleName.c_str()); + } + return static_cast(status); +} +} // namespace OHOS::CloudData \ No newline at end of file diff --git a/relational_store/interfaces/inner_api/cloud_data/include/cloud_manager.h b/relational_store/interfaces/inner_api/cloud_data/include/cloud_manager.h new file mode 100644 index 00000000..b17c49de --- /dev/null +++ b/relational_store/interfaces/inner_api/cloud_data/include/cloud_manager.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_H +#define OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_H + +#include +#include +#include "cloud_service.h" +#include "rdb_visibility.h" + +namespace OHOS::CloudData { +class RDB_API_EXPORT CloudManager final { +public: + /** + * @brief Obtain cloud service. + */ + static std::shared_ptr GetCloudService(); +}; +} // namespace OHOS::CloudData +#endif // OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_MANAGER_H diff --git a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h index 260c1a06..c3040ff7 100644 --- a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h +++ b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h @@ -44,6 +44,14 @@ public: SWITCH_OFF }; + enum Status : int32_t + { + SUCCESS = 0, + ERROR, + IPC_ERROR, + IPC_PARCEL_ERROR + }; + static constexpr const char *SERVICE_NAME = "cloud"; virtual ~CloudService() = default; virtual int32_t EnableCloud(const std::string &id, const std::map &switches) = 0; -- Gitee