提交 c892f47c 编写于 作者: L lsq

api意见闭环

Signed-off-by: Nlsq <linshuqing2@huawei.com>
Change-Id: I3e109f7eb6016fadc98e4d1b8553a8694979a5f6
上级 59a648aa
...@@ -114,9 +114,9 @@ try { ...@@ -114,9 +114,9 @@ try {
} }
``` ```
## privacyManager.getPermissionUsedRecords ## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest): Promise&lt;PermissionUsedResponse&gt; getPermissionUsedRecord(request: PermissionUsedRequest): Promise&lt;PermissionUsedResponse&gt;
Obtains historical permission usage records. This API uses a promise to return the result. Obtains historical permission usage records. This API uses a promise to return the result.
...@@ -161,19 +161,19 @@ let request = { ...@@ -161,19 +161,19 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL, "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
}; };
try { try {
privacyManager.getPermissionUsedRecords(request).then((data) => { privacyManager.getPermissionUsedRecord(request).then((data) => {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`); console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`); console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
}); });
} catch(err) { } catch(err) {
console.log(`catch err->${JSON.stringify(err)}`); console.log(`catch err->${JSON.stringify(err)}`);
} }
``` ```
## privacyManager.getPermissionUsedRecords ## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback&lt;PermissionUsedResponse&gt;): void getPermissionUsedRecord(request: PermissionUsedRequest, callback: AsyncCallback&lt;PermissionUsedResponse&gt;): void
Obtains historical permission usage records. This API uses an asynchronous callback to return the result. Obtains historical permission usage records. This API uses an asynchronous callback to return the result.
...@@ -213,11 +213,11 @@ let request = { ...@@ -213,11 +213,11 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL, "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
}; };
try { try {
privacyManager.getPermissionUsedRecords(request, (err, data) => { privacyManager.getPermissionUsedRecord(request, (err, data) => {
if (err) { if (err) {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`); console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else { } else {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`); console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
} }
}); });
} catch(err) { } catch(err) {
......
...@@ -120,9 +120,9 @@ try { ...@@ -120,9 +120,9 @@ try {
} }
``` ```
## privacyManager.getPermissionUsedRecords ## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest): Promise&lt;PermissionUsedResponse&gt; getPermissionUsedRecord(request: PermissionUsedRequest): Promise&lt;PermissionUsedResponse&gt;
获取历史权限使用记录。使用Promise异步回调。 获取历史权限使用记录。使用Promise异步回调。
...@@ -170,19 +170,19 @@ let request = { ...@@ -170,19 +170,19 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL, "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
}; };
try { try {
privacyManager.getPermissionUsedRecords(request).then((data) => { privacyManager.getPermissionUsedRecord(request).then((data) => {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`); console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`); console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
}); });
} catch(err) { } catch(err) {
console.log(`catch err->${JSON.stringify(err)}`); console.log(`catch err->${JSON.stringify(err)}`);
} }
``` ```
## privacyManager.getPermissionUsedRecords ## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback&lt;PermissionUsedResponse&gt;): void getPermissionUsedRecord(request: PermissionUsedRequest, callback: AsyncCallback&lt;PermissionUsedResponse&gt;): void
获取历史权限使用记录。使用callback异步回调。 获取历史权限使用记录。使用callback异步回调。
...@@ -225,11 +225,11 @@ let request = { ...@@ -225,11 +225,11 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL, "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
}; };
try { try {
privacyManager.getPermissionUsedRecords(request, (err, data) => { privacyManager.getPermissionUsedRecord(request, (err, data) => {
if (err) { if (err) {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`); console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else { } else {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`); console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
} }
}); });
} catch(err) { } catch(err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册