docs: 完善部署接口说明
author刘洪青 <hongqing.liu@supwisdom.com>
Tue, 7 Sep 2021 14:33:39 +0000 (22:33 +0800)
committer刘洪青 <hongqing.liu@supwisdom.com>
Tue, 7 Sep 2021 14:33:39 +0000 (22:33 +0800)
docs/产品部署之中台服务对接数据初始化相关接口的说明.md

index 010e8b7..a3ad150 100644 (file)
@@ -66,7 +66,7 @@ commit;
 
 修改 INFORMATION_URL、LOGOUT_URL、SERVICE_ID、APPLICATION_DOMAIN,相关地址、域名修改
 
-> TB_SERVICE
+> 应用对接表 TB_SERVICE
 
 字段名 | 字段说明
 - | -
@@ -143,7 +143,7 @@ VALUES ('0', '1', 0, 'init', null,
 commit;
 ```
 
-> TB_R_SYSTEM
+> 系统信息表 TB_R_SYSTEM
 
 字段名 | 字段说明
 - | -
@@ -159,7 +159,7 @@ NAME | 系统名称
 ENABLED | 是否启用(1 启用,0 禁用)
 
 
-> TB_APPLICATION
+> 应用信息表 TB_APPLICATION
 
 字段名 | 字段说明
 - | -
@@ -177,7 +177,7 @@ SYNC_URL | 角色数据的同步接口。若不需要,可以为空
 ENABLED | 是否启用(1 启用,0 禁用)
 
 
-> TB_ROLE
+> 角色表 TB_ROLE
 
 字段名 | 字段说明
 - | -
@@ -196,7 +196,7 @@ EXTERNAL_ID | 对应所在应用内的数据的ID
 
 
 
-### 云平台菜单
+### 云平台菜单、操作
 
 **采用业务管理接口进行部署**
 
@@ -238,7 +238,55 @@ curl -i -s -X POST \
   'http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin/menus/importMenu'
 ```
 
-> 角色权限(关联菜单)
+> 导入操作(按钮权限)
+
+```bash
+curl -i -s -X POST \
+  -H 'Content-Type: application/json' \
+  -d '{
+  "applicationId": "0",
+  "operationList": 
+    [
+      {
+        "id": "0-10000-10001", "parentIdOrCode":"0-10000", "code": "example-10000-10001", "name": "示例一级-操作", "memo": "", "status": "1", 
+        "order": 10001, "resourceIdOrCodes": []
+      },
+      {
+        "id": "0-10100-10101", "parentIdOrCode":"0-10100", "code": "example-10100-10101", "name": "示例二级-操作", "memo": "", "status": "1", 
+        "order": 10101, "resourceIdOrCodes": []
+      },
+    ……
+    ]
+}' \
+  'http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin/operations/importOperation'
+```
+
+> 导入资源
+
+```bash
+curl -i -s -X POST \
+  -H 'Content-Type: application/json' \
+  -d '{
+  "applicationId": "0",
+  "resourceList": 
+    [
+      {
+        "id": "0-10001", "code": "example-10001", "name": "示例资源一", "memo": "", "status": "1", 
+        "origin": "http://admin-platform.paas.xxx.edu.cn", "method": "GET", "path": "/api/v1/example/10001", "access": "authenticate", 
+        "order": 10001, "resourceIdOrCodes": []
+      },
+      {
+        "id": "0-10002", "code": "example-10002", "name": "示例资源二", "memo": "", "status": "1", 
+        "origin": "http://admin-platform.paas.xxx.edu.cn", "method": "GET", "path": "/api/v1/example/10001", "access": "authenticate", 
+        "order": 10002, "resourceIdOrCodes": []
+      },
+    ……
+    ]
+}' \
+  'http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin/resources/importResource'
+```
+
+> 角色权限(关联菜单、操作)
 
 ```bash
 curl -i -s -X POST \
@@ -247,8 +295,8 @@ curl -i -s -X POST \
   "rolePermissionList": 
     [
       {
-        "roleId": "0", "roleCode":"example-admin", 
-        "permissionIdOrCodes": ["0-10000", "0-10100"]
+        "roleCode":"example-admin", 
+        "permissionIdOrCodes": ["0-10000", "0-10100", "0-10000-10001", "0-10100-10101"]
       },
     ……
     ]
@@ -287,6 +335,36 @@ order | 排序
 resourceIdOrCodes | 关联的资源(后端接口)的ID 或 代码。数组,可以为空
 
 
+> 操作的属性说明
+
+属性名 | 说明
+- | -
+id | 确保唯一性
+parentIdOrCode | 上级菜单的ID 或 代码
+code | 操作代码
+name | 操作名称
+memo | 描述
+status | 状态(1 启用,0 停用)
+order | 排序
+resourceIdOrCodes | 关联的资源(后端接口)的ID 或 代码。数组,可以为空
+
+
+> 资源的属性说明
+
+属性名 | 说明
+- | -
+id | 确保唯一性
+parentIdOrCode | 上级菜单的ID 或 代码
+code | 资源代码
+name | 资源名称
+memo | 描述
+status | 状态(1 启用,0 停用)
+origin | 归属域名,一般为 admin-platform 的域名
+method | GET, POST, PUT, DELETE 四选一
+path | 资源的请求路径
+access | 访问规则。anonymous, 匿名访问(未登录时,可访问);authenticate, 认证访问(登录后,可访问);authorize, 授权访问(须授权后,可访问);permitAll, 允许所有(都可访问);denyAll, 拒绝所有(都不可访问)。
+
+
 > 角色权限的属性说明
 
 属性名 | 说明