From 73473a609ea0ec86cf6f2c0dae6973eb14791da2 Mon Sep 17 00:00:00 2001 From: zhanghengrui-ifanr Date: Thu, 3 Nov 2022 18:41:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=9F=A5=E6=99=93=E4=BA=91=20OpenAPI=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=83=A8=E7=BD=B2=E8=BF=90=E8=90=A5=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUMMARY.md | 1 + open-api/README.md | 1 + open-api/user-dash.md | 100 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 open-api/user-dash.md diff --git a/SUMMARY.md b/SUMMARY.md index cc916034..987fe9ab 100755 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -276,6 +276,7 @@ * [组集操作](open-api/group/super-group.md) * [云函数](open-api/cloud-function.md) * [短信服务](open-api/sms.md) + * [运营后台](open-api/user-dash.md) ---- diff --git a/open-api/README.md b/open-api/README.md index 994b9bfe..03b0c197 100644 --- a/open-api/README.md +++ b/open-api/README.md @@ -15,3 +15,4 @@ * [用户模块](./user/README.md) * [云函数](./cloud-function.md) * [工具模块](./utils.md) +* [运营模块](./user-dash.md) diff --git a/open-api/user-dash.md b/open-api/user-dash.md new file mode 100644 index 00000000..d0f9a8cd --- /dev/null +++ b/open-api/user-dash.md @@ -0,0 +1,100 @@ +# 运营后台 + +## 部署运营后台 + +**接口** + +`POST https://cloud.minapp.com/oserve/v2.6/miniapp/custom-userdash/` + +**参数说明** + +Content-Type: `application/json` + +| 参数 | 类型 | 必填 | 说明 | +| :------------ | :----- | :-- | :-- | +| repository_path | String | N | 自定义管理后台部署压缩包地址,需要先调用上传文件接口获取文件上传成功后的访问地址 | +| url_refresh | String | N | 是否刷新管理后台部署地址,取值为:true or false,可为空,默认为 true | + +**代码示例** + +{% tabs getTokenV21Curl="Curl", getTokenV21Node="Node", getTokenV21PHP="PHP" %} + +{% content "getTokenV21Curl"%} + +``` +curl -X POST \ +-H "Authorization: Bearer 52ce223c5adbb66fa188a959a8b08889adb3580c" \ +-H "Content-Type: application/json" \ +-d '{ + "repository_path":"https://baas-hello-world.cloud.ifanrusercontent.com/test.zip", + "url_refresh": true + }' \ +https://cloud.minapp.com/oserve/v2.6/miniapp/custom-userdash/ +``` + +{% content "getTokenV21Node"%} + +```js +var request = require('request'); + +var opt = { + uri: 'https://cloud.minapp.com/oserve/v2.6/miniapp/custom-userdash/', + method: 'POST', + headers: { + Authorization: `Bearer ${token}` + }, + json: { + repository_path: 'https://baas-hello-world.cloud.ifanrusercontent.com/test.zip', + url_refresh: 'true' + } +} + +request(opt, function(err, res, body) { + console.log(res.statusCode, body) +}) +``` + +{% content "getTokenV21PHP"%} + +```php +'https://baas-hello-world.cloud.ifanrusercontent.com/test.zip', + 'url_refresh'=> 'true' +); +$url = 'https://cloud.minapp.com/oserve/v2.6/miniapp/custom-userdash/'; + +$ch = curl_init(); +$header = array( + "Authorization: Bearer {$token}", + 'Content-Type: application/json; charset=utf-8' +); + +curl_setopt($ch, CURLOPT_HTTPHEADER, $header); +curl_setopt($ch, CURLOPT_TIMEOUT, 30); +curl_setopt($ch, CURLOPT_URL, $url); +curl_setopt($ch, CURLOPT_POST, true); +curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($param)); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); +curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + +$res['response'] = curl_exec($ch); // 反馈结果 +$res['status_code'] = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 请求状态码 +curl_close($ch); +``` + +{% endtabs %} + +**返回示例** + +```json + { + "message": "Submit deploy request succeed.", + "status": "ok" + } +``` + +**状态码说明** + +`200` 成功 +`403` 套餐不符合或企业认证未完成 From 0e4e8a701b32fd2c2eccf5622f906fef73c42d08 Mon Sep 17 00:00:00 2001 From: zhanghengrui-ifanr Date: Fri, 4 Nov 2022 11:13:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=9F=A5=E6=99=93=E4=BA=91=20OpenAPI=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=90=A5=E9=83=A8=E7=BD=B2=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E8=A1=A8=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=B7=B3=E8=BD=AC=20ACL=20=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- open-api/data/table.md | 4 ++-- open-api/user-dash.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/open-api/data/table.md b/open-api/data/table.md index ec155f22..5123ed43 100644 --- a/open-api/data/table.md +++ b/open-api/data/table.md @@ -29,7 +29,7 @@ | user:<:user_id> | String| 某个用户可写/可读 | | gid:<:group_id> | String| 某个分组下的用户可写/可读 | -具体描述与使用场景可参考[ACL 访问控制列表](../../dashboard/acl.md)。 +具体描述与使用场景可参考[ACL 访问控制列表](../../dashboard/basic-services/acl.md)。 参数 schema 用于存储数据表字段的元信息,其结构遵循[JSON-Table-Schema](https://frictionlessdata.io/specs/table-schema/)的描述。 @@ -236,7 +236,7 @@ curl_close($ch); { "name": "String", "type": "string", - "description": "string", + "description": "string" } ] }, diff --git a/open-api/user-dash.md b/open-api/user-dash.md index d0f9a8cd..480b96bd 100644 --- a/open-api/user-dash.md +++ b/open-api/user-dash.md @@ -12,14 +12,14 @@ Content-Type: `application/json` | 参数 | 类型 | 必填 | 说明 | | :------------ | :----- | :-- | :-- | -| repository_path | String | N | 自定义管理后台部署压缩包地址,需要先调用上传文件接口获取文件上传成功后的访问地址 | +| repository_path | String | N | 自定义管理后台部署压缩包地址,需要先调用[上传文件接口](./file/file-upload.md)获取文件上传成功后的访问地址 | | url_refresh | String | N | 是否刷新管理后台部署地址,取值为:true or false,可为空,默认为 true | **代码示例** -{% tabs getTokenV21Curl="Curl", getTokenV21Node="Node", getTokenV21PHP="PHP" %} +{% tabs createCustomUserDashCurl="Curl", createCustomUserDashNode="Node", createCustomUserDashPHP="PHP" %} -{% content "getTokenV21Curl"%} +{% content "createCustomUserDashCurl"%} ``` curl -X POST \ @@ -32,7 +32,7 @@ curl -X POST \ https://cloud.minapp.com/oserve/v2.6/miniapp/custom-userdash/ ``` -{% content "getTokenV21Node"%} +{% content "createCustomUserDashNode"%} ```js var request = require('request'); @@ -54,7 +54,7 @@ request(opt, function(err, res, body) { }) ``` -{% content "getTokenV21PHP"%} +{% content "createCustomUserDashPHP"%} ```php