1 /* 2 * Copyright (c) 2024 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_DM_KV_INFO_H 17 #define OHOS_DM_KV_INFO_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace DistributedHardware { 23 const std::string DB_KEY_DELIMITER = "###"; 24 const std::string UDID_HASH_KEY = "udidHash"; 25 const std::string APP_ID_KEY = "appID"; 26 const std::string ANOY_DEVICE_ID_KEY = "anoyDeviceId"; 27 const std::string SALT_KEY = "salt"; 28 const std::string LAST_MODIFY_TIME_KEY = "lastModifyTime"; 29 30 typedef struct DmKVValue { 31 std::string udidHash; 32 std::string appID; 33 std::string anoyDeviceId; 34 std::string salt; 35 int64_t lastModifyTime; DmKVValueDmKVValue36 explicit DmKVValue() : udidHash(""), appID(""), anoyDeviceId(""), salt(""), lastModifyTime(0) {} 37 } DmKVValue; 38 void ConvertDmKVValueToJson(const DmKVValue &kvValue, std::string &result); 39 void ConvertJsonToDmKVValue(const std::string &result, DmKVValue &kvValue); 40 } // namespace DistributedHardware 41 } // namespace OHOS 42 #endif // OHOS_DM_KV_INFO_H