修复检视意见

Signed-off-by: wangzhaohao <wangzhaohao@huawei.com>
This commit is contained in:
wangzhaohao 2024-11-03 18:48:51 +08:00
parent 6ab0da98ce
commit 230938251e
3 changed files with 4 additions and 4 deletions

View File

@ -130,7 +130,7 @@ std::string CharacteristicProfile::dump() const
cJSON_AddStringToObject(json, SERVICE_NAME.c_str(), serviceName_.c_str()); cJSON_AddStringToObject(json, SERVICE_NAME.c_str(), serviceName_.c_str());
cJSON_AddStringToObject(json, CHARACTERISTIC_KEY.c_str(), characteristicKey_.c_str()); cJSON_AddStringToObject(json, CHARACTERISTIC_KEY.c_str(), characteristicKey_.c_str());
cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_); cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_);
cJSON_AddNumberToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_)); cJSON_AddStringToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_).c_str());
if (characteristicKey_ == SWITCH_STATUS) { if (characteristicKey_ == SWITCH_STATUS) {
cJSON_AddStringToObject(json, CHARACTERISTIC_VALUE.c_str(), characteristicValue_.c_str()); cJSON_AddStringToObject(json, CHARACTERISTIC_VALUE.c_str(), characteristicValue_.c_str());
} else { } else {

View File

@ -225,7 +225,7 @@ std::string DeviceProfile::dump() const
cJSON_AddStringToObject(json, OS_VERSION.c_str(), osVersion_.c_str()); cJSON_AddStringToObject(json, OS_VERSION.c_str(), osVersion_.c_str());
cJSON_AddNumberToObject(json, OS_TYPE.c_str(), osType_); cJSON_AddNumberToObject(json, OS_TYPE.c_str(), osType_);
cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_); cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_);
cJSON_AddNumberToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_)); cJSON_AddStringToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_).c_str());
char* jsonChars = cJSON_PrintUnformatted(json); char* jsonChars = cJSON_PrintUnformatted(json);
if (jsonChars == NULL) { if (jsonChars == NULL) {
cJSON_Delete(json); cJSON_Delete(json);
@ -262,7 +262,7 @@ std::string DeviceProfile::AnnoymizeDump() const
cJSON_AddStringToObject(json, OS_TYPE.c_str(), cJSON_AddStringToObject(json, OS_TYPE.c_str(),
ProfileUtils::GetAnonyString(std::to_string(osType_)).c_str()); ProfileUtils::GetAnonyString(std::to_string(osType_)).c_str());
cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_); cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_);
cJSON_AddNumberToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_)); cJSON_AddStringToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_).c_str());
char* jsonChars = cJSON_PrintUnformatted(json); char* jsonChars = cJSON_PrintUnformatted(json);
if (jsonChars == NULL) { if (jsonChars == NULL) {
cJSON_Delete(json); cJSON_Delete(json);

View File

@ -136,7 +136,7 @@ std::string ServiceProfile::dump() const
cJSON_AddStringToObject(json, SERVICE_NAME.c_str(), serviceName_.c_str()); cJSON_AddStringToObject(json, SERVICE_NAME.c_str(), serviceName_.c_str());
cJSON_AddStringToObject(json, SERVICE_TYPE.c_str(), serviceType_.c_str()); cJSON_AddStringToObject(json, SERVICE_TYPE.c_str(), serviceType_.c_str());
cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_); cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_);
cJSON_AddNumberToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_)); cJSON_AddStringToObject(json, USER_ID.c_str(), ProfileUtils::GetAnonyInt32(userId_).c_str());
char* jsonChars = cJSON_PrintUnformatted(json); char* jsonChars = cJSON_PrintUnformatted(json);
if (jsonChars == NULL) { if (jsonChars == NULL) {
cJSON_Delete(json); cJSON_Delete(json);