Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
2a5a8a49
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2a5a8a49
编写于
6月 16, 2023
作者:
S
srr101
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
示例代码日志打印整改
Signed-off-by:
N
srr101
<
songruirui1@huawei.com
>
上级
be976d37
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
zh-cn/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
...nce/apis/js-apis-application-dataShareExtensionAbility.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-data-DataShareResultSet.md
...ion-dev/reference/apis/js-apis-data-DataShareResultSet.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md
.../application-dev/reference/apis/js-apis-data-dataShare.md
+3
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
浏览文件 @
2a5a8a49
...
...
@@ -102,7 +102,7 @@ let rdbStore;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
insert
(
uri
,
valueBucket
,
callback
)
{
if
(
valueBucket
===
null
)
{
console
.
info
(
'
invalid valueBuckets
'
);
console
.
error
(
'
invalid valueBuckets
'
);
return
;
}
rdbStore
.
insert
(
TBL_NAME
,
valueBucket
,
function
(
err
,
ret
)
{
...
...
@@ -277,7 +277,7 @@ let rdbStore;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
batchInsert
(
uri
,
valueBuckets
,
callback
)
{
if
(
valueBuckets
===
null
||
valueBuckets
.
length
===
undefined
)
{
console
.
info
(
'
invalid valueBuckets
'
);
console
.
error
(
'
invalid valueBuckets
'
);
return
;
}
rdbStore
.
batchInsert
(
TBL_NAME
,
valueBuckets
,
function
(
err
,
ret
)
{
...
...
zh-cn/application-dev/reference/apis/js-apis-data-DataShareResultSet.md
浏览文件 @
2a5a8a49
...
...
@@ -27,7 +27,7 @@ let dataShareHelper;
let
uri
=
(
"
datashare:///com.samples.datasharetest.DataShare
"
);
await
dataShare
.
createDataShareHelper
(
this
.
context
,
uri
,
(
err
,
data
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
"
createDataShareHelper fail, error message :
"
+
err
);
console
.
error
(
"
createDataShareHelper fail, error message :
"
+
err
);
}
else
{
console
.
info
(
"
createDataShareHelper end, data :
"
+
data
);
dataShareHelper
=
data
;
...
...
@@ -39,10 +39,10 @@ let da = new dataSharePredicates.DataSharePredicates();
let
resultSet
;
da
.
equalTo
(
"
name
"
,
"
ZhangSan
"
);
dataShareHelper
.
query
(
uri
,
da
,
columns
).
then
((
data
)
=>
{
console
.
log
(
"
query end, data :
"
+
data
);
console
.
info
(
"
query end, data :
"
+
data
);
resultSet
=
data
;
}).
catch
((
err
)
=>
{
console
.
log
(
"
query fail, error message :
"
+
err
);
console
.
error
(
"
query fail, error message :
"
+
err
);
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md
浏览文件 @
2a5a8a49
...
...
@@ -587,7 +587,7 @@ try {
console
.
info
(
"
data length is:
"
,
data
.
length
);
dataShareHelper
.
publish
(
data
,
"
com.acts.ohos.data.datasharetest
"
,
version
,
publishCallback
);
}
catch
(
e
)
{
console
.
info
(
"
publish error
"
+
JSON
.
stringify
(
e
));
console
.
error
(
"
publish error
"
+
JSON
.
stringify
(
e
));
}
```
...
...
@@ -1217,7 +1217,7 @@ denormalizeUri(uri: string, callback: AsyncCallback<string>): void
let
uri
=
(
"
datashare:///com.samples.datasharetest.DataShare
"
);
dataShareHelper
.
denormalizeUri
(
uri
,
(
err
,
data
)
=>
{
if
(
err
!==
undefined
)
{
console
.
info
(
"
denormalizeUri failed, error message :
"
+
err
);
console
.
error
(
"
denormalizeUri failed, error message :
"
+
err
);
}
else
{
console
.
info
(
"
denormalizeUri =
"
+
data
);
}
...
...
@@ -1251,7 +1251,7 @@ let uri = ("datashare:///com.samples.datasharetest.DataShare");
dataShareHelper
.
denormalizeUri
(
uri
).
then
((
data
)
=>
{
console
.
info
(
"
denormalizeUri =
"
+
data
);
}).
catch
((
err
)
=>
{
console
.
info
(
"
denormalizeUri failed, error message :
"
+
err
);
console
.
error
(
"
denormalizeUri failed, error message :
"
+
err
);
});
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录