mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-27 00:51:12 +00:00
!2305 修复cjson不支持int64类型的卡片id,导致精度科学计数法。影响卡片展示
Merge pull request !2305 from wangjiaqiang/master
This commit is contained in:
commit
50a446df79
@ -59,7 +59,14 @@ bool TemplateRootNode::Unmarshal(const DistributedData::Serializable::json &node
|
||||
{
|
||||
bool ret = GetValue(node, GET_NAME(uri), uri);
|
||||
ret = ret && GetValue(node, GET_NAME(bundleName), bundleName);
|
||||
ret = ret && GetValue(node, GET_NAME(subscriberId), subscriberId);
|
||||
if (!GetValue(node, GET_NAME(subscriberId), subscriberId)) {
|
||||
int64_t subId;
|
||||
if (GetValue(node, GET_NAME(subscriberId), subId)) {
|
||||
subscriberId = std::to_string(subId);
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
ret = ret && GetValue(node, GET_NAME(userId), userId);
|
||||
ret = ret && GetValue(node, GET_NAME(templat), tpl);
|
||||
return ret;
|
||||
@ -67,7 +74,7 @@ bool TemplateRootNode::Unmarshal(const DistributedData::Serializable::json &node
|
||||
|
||||
TemplateRootNode::TemplateRootNode(const std::string &uri, const std::string &bundleName, const int64_t subscriberId,
|
||||
const int32_t userId, const Template &tpl)
|
||||
: uri(uri), bundleName(bundleName), subscriberId(subscriberId), userId(userId), tpl(tpl)
|
||||
: uri(uri), bundleName(bundleName), subscriberId(std::to_string(subscriberId)), userId(userId), tpl(tpl)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ struct TemplateRootNode final: public DistributedData::Serializable {
|
||||
private:
|
||||
std::string uri;
|
||||
std::string bundleName;
|
||||
int64_t subscriberId;
|
||||
std::string subscriberId;
|
||||
int32_t userId;
|
||||
TemplateNode tpl;
|
||||
};
|
||||
|
@ -344,7 +344,8 @@ int RdbSubscriberManager::Notify(const Key &key, int32_t userId, const std::vect
|
||||
changeNode.data_.emplace_back("{\"" + predicate.key_ + "\":" + result + "}");
|
||||
}
|
||||
|
||||
ZLOGI("emit, size %{public}zu %{private}s", val.size(), changeNode.uri_.c_str());
|
||||
ZLOGI("emit, valSize: %{public}zu, dataSize:%{public}zu, uri:%{public}s,",
|
||||
val.size(), changeNode.data_.size(), DistributedData::Anonymous::Change(changeNode.uri_).c_str());
|
||||
for (const auto &callback : val) {
|
||||
if (callback.enabled && callback.observer != nullptr) {
|
||||
callback.observer->OnChangeFromRdb(changeNode);
|
||||
|
Loading…
Reference in New Issue
Block a user