Browse Source

add schema

yaoll 4 years ago
parent
commit
e9c82d5692
3 changed files with 246 additions and 33 deletions
  1. 1 0
      .gitignore
  2. 20 33
      docs/.vuepress/config.js
  3. 225 0
      docs/rwd/schema.md

+ 1 - 0
.gitignore

@@ -27,4 +27,5 @@ build/Release
 # Dependency directory
 # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
 node_modules
+dist
 

+ 20 - 33
docs/.vuepress/config.js

@@ -3,17 +3,17 @@ module.exports = {
     description: 'Just playing around',
     plugins: ['@vuepress/back-to-top'],
     themeConfig: {
-
-        nav: [{ text: '主页', link: '/' },
+        nav: [
+            { text: '主页', link: '/' },
             { text: '通用查询接口', link: '/utils/query' },
             { text: '物理世界', link: '/rwd/' },
             { text: '人员组织权限', link: '/org/' },
-            { text: '数据标准化', link: '/dic/'},
+            { text: '数据标准化', link: '/dic/' },
             { text: '任务调度', link: '/task/' },
-            { text: '报警系统', link: '/alarm/'},
-            { text: '报表统计系统', link: '/report/'},
-            { text: '数据仓库', link: '/dw/'}
-            ],
+            { text: '报警系统', link: '/alarm/' },
+            { text: '报表统计系统', link: '/report/' },
+            { text: '数据仓库', link: '/dw/' }
+        ],
 
         sidebarDepth: 2,
         displayAllHeaders: true,
@@ -22,29 +22,21 @@ module.exports = {
                 {
                     title: '通用查询接口',
                     collapsable: false,
-                    children: [
-                        {title: '通用查询', path: '/utils/query'}
-                    ]
+                    children: [{ title: '通用查询', path: '/utils/query' }]
                 }
             ],
             '/dw': [
                 {
                     title: '数据仓库',
                     collapsable: false,
-                    children: [
-                        {title: '配置计划', path: '/dw/dw_config'},
-                        {title: '搭建部署', path: '/dw/dw_deploy'}
-                    ]
+                    children: [{ title: '配置计划', path: '/dw/dw_config' }, { title: '搭建部署', path: '/dw/dw_deploy' }]
                 }
             ],
             '/report': [
                 {
                     title: '报表统计系统',
                     collapsable: false,
-                    children: [
-                        {title: '接口文档', path: '/report/report_api'},
-                        {title: '数据结构设计', path: '/report/report_design'}
-                    ]
+                    children: [{ title: '接口文档', path: '/report/report_api' }, { title: '数据结构设计', path: '/report/report_design' }]
                 }
             ],
             '/alarm': [
@@ -52,9 +44,9 @@ module.exports = {
                     title: '报警系统',
                     collapsable: false,
                     children: [
-                        {title: '接口文档', path: '/alarm/alarm_api'},
-                        {title: '数据字典', path: '/alarm/alarm_dict'},
-                        {title: '数据结构设计', path: '/alarm/alarm_design'}
+                        { title: '接口文档', path: '/alarm/alarm_api' },
+                        { title: '数据字典', path: '/alarm/alarm_dict' },
+                        { title: '数据结构设计', path: '/alarm/alarm_design' }
                     ]
                 }
             ],
@@ -62,30 +54,21 @@ module.exports = {
                 {
                     title: '人员组织权限',
                     collapsable: false,
-                    children: [
-                        {title: '接口文档', path: '/org/org_api'},
-                        {title: '数据结构设计', path: '/org/org_design'}
-                    ]
+                    children: [{ title: '接口文档', path: '/org/org_api' }, { title: '数据结构设计', path: '/org/org_design' }]
                 }
             ],
             '/task': [
                 {
                     title: '数据标准化',
                     collapsable: false,
-                    children: [
-                        {title: '接口文档', path: '/task/task_api'},
-                        {title: '数据结构设计', path: '/task/task_design'}
-                    ]
+                    children: [{ title: '接口文档', path: '/task/task_api' }, { title: '数据结构设计', path: '/task/task_design' }]
                 }
             ],
             '/dic': [
                 {
                     title: '数据标准化',
                     collapsable: false,
-                    children: [
-                        {title: '接口文档', path: '/dic/dic_api'},
-                        {title: '数据结构设计', path: '/dic/dic_design'}
-                    ]
+                    children: [{ title: '接口文档', path: '/dic/dic_api' }, { title: '数据结构设计', path: '/dic/dic_design' }]
                 }
             ],
             '/rwd': [
@@ -95,6 +78,10 @@ module.exports = {
                     children: [{ title: '类型定义', path: '/rwd/def_class' }, { title: '信息点定义', path: '/rwd/def_funcid' }]
                 },
                 {
+                    title: '订阅功能',
+                    path: '/rwd/schema'
+                },
+                {
                     title: '实例数据',
                     collapsable: false,
                     children: [{ title: '对象数据', path: '/rwd/instance_object' }, { title: '关系数据', path: '/rwd/instance_relation' }]

+ 225 - 0
docs/rwd/schema.md

@@ -0,0 +1,225 @@
+### 字典订阅
+
+#### 集团方案
+
+```
+目前只提供集团方案的创建、编辑和查询接口
+
+```
+
+数据结构
+| 字段 | 数据类型 | 查询字段 | 说明 |
+| ------------- | -------- | -------- | --------------------------------------------------------------- |
+| id | String | Y | 全局唯一 |
+| name | String | Y | 名称,不可为空 |
+| groupCode | String | Y | 集团编码, 不可为空 |
+| remark | String | Y | 备注 |
+| status | String | Y | 状态 |
+
+###### 查询
+
+请求方式
+
+```
+POST /rwd/schema/query?groupCode=集团编码
+```
+
+路径参数说明
+
+| 字段      | 数据类型 | 说明              |
+| --------- | -------- | ----------------- |
+| groupCode | String   | 集团编码,不可为空 |
+
+请求体
+
+```
+{
+    "criteria": {
+    }
+}
+
+```
+
+返回数据
+
+```
+{
+    "result": "success",
+    "data": [
+        {
+            "id": "ZS-BUSI",
+            "name": "商业",
+            "groupCode": "ZS",
+            "status": 1
+        }
+    ],
+    "count": 1
+}
+
+```
+
+###### 创建
+
+请求方式
+
+```
+POST /rwd/schema/create?groupCode=集团编码
+```
+
+路径参数说明
+
+| 字段      | 数据类型 | 说明              |
+| --------- | -------- | ----------------- |
+| groupCode | String   | 集团编码,不可为空 |
+
+请求体
+
+```
+{
+    "id": "ZS-BUSI2",
+    "name": "商业2"
+}
+```
+
+返回数据
+
+```
+{
+    "result": "success",
+    "data": {
+        "id": "ZS-BUSI2"
+    }
+}
+
+```
+
+###### 编辑
+
+```
+只能更新name和remark字段
+```
+
+请求方式
+
+```
+POST /rwd/schema/update?groupCode=集团编码
+```
+
+路径参数说明
+
+| 字段      | 数据类型 | 说明              |
+| --------- | -------- | ----------------- |
+| groupCode | String   | 集团编码,不可为空 |
+
+请求体
+
+```
+{
+    "id": "ZS-BUSI2",
+    "name": "商业3"
+}
+```
+
+返回数据
+
+```
+{
+    "result": "success",
+    "data": {
+        "id": "ZS-BUSI2"
+    }
+}
+
+```
+
+#### 配置项目方案
+
+```
+项目必须配置一个集团方案,且配置后不允许修改
+```
+
+数据结构
+| 字段 | 数据类型 | 查询字段 | 说明 |
+| ------------- | -------- | -------- | --------------------------------------------------------------- |
+| groupCode | String | Y | 集团编码, 不可为空 |
+| schemaId | String | Y | 集团方案 ID, 不可为空 |
+| projectId | String | Y | 项目 Id, 不可为空 |
+
+###### 查询
+
+请求方式
+
+```
+POST /rwd/schema/project/query?groupCode=集团编码
+```
+
+路径参数说明
+
+| 字段      | 数据类型 | 说明              |
+| --------- | -------- | ----------------- |
+| groupCode | String   | 集团编码,不可为空 |
+
+请求体
+
+```
+{
+    "criteria": {
+    }
+}
+
+```
+
+返回数据
+
+```
+{
+    "result": "success",
+    "data": [
+        {
+            "id": "ZS-BUSI-Pj4403050019",
+            "schemaId": "ZS-BUSI",
+            "groupCode": "ZS",
+            "projectId": "Pj4403050019"
+        }
+    ],
+    "count": 1
+}
+
+```
+
+###### 创建
+
+请求方式
+
+```
+POST /rwd/schema/project/create?groupCode=集团编码
+```
+
+路径参数说明
+
+| 字段      | 数据类型 | 说明              |
+| --------- | -------- | ----------------- |
+| groupCode | String   | 集团编码,不可为空 |
+
+请求体
+
+```
+{
+    "id": "ZS-BUSI-Pj4403050019",
+    "schemaId": "ZS-BUSI",
+    "projectId": "Pj4403050019"
+}
+
+```
+
+返回数据
+
+```
+{
+    "result": "success",
+    "data": {
+        "id": "ZS-BUSI-Pj4403050019"
+    }
+}
+
+```