• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 
16 #ifndef OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_LAST_SYNC_INFO_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_LAST_SYNC_INFO_H
18 
19 #include "serializable/serializable.h"
20 #include "visibility.h"
21 
22 namespace OHOS::DistributedData {
23 class API_EXPORT CloudLastSyncInfo final : public Serializable {
24 public:
25     std::string id = "";
26     std::string storeId = "";
27     int64_t startTime = 0;
28     int64_t finishTime = 0;
29     int32_t code = -1;
30     int32_t syncStatus = 0;
31     int32_t instanceId = 0;
32     bool Marshal(json &node) const override;
33     bool Unmarshal(const json &node) override;
34     static std::string GetKey(const int32_t user, const std::string &bundleName,
35                               const std::string &storeId, int32_t instanceId = 0);
36 private:
37     static constexpr const char *INFO_PREFIX = "CLOUD_LAST_SYNC_INFO";
38     static std::string GetKey(const std::string &prefix, const std::initializer_list<std::string> &fields);
39 };
40 } // namespace OHOS::DistributedData
41 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_LAST_SYNC_INFO_H