Procházet zdrojové kódy

Merge branch 'master' of http://39.106.8.246:3003/persagy/persagy-dmp-server-doc

lixing před 4 roky
rodič
revize
89559b5e79
5 změnil soubory, kde provedl 297 přidání a 67 odebrání
  1. 1 0
      .gitignore
  2. 20 33
      docs/.vuepress/config.js
  3. 45 28
      docs/org/org_api.md
  4. 6 6
      docs/rwd/iot.md
  5. 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' }]

+ 45 - 28
docs/org/org_api.md

@@ -4,26 +4,22 @@
 
 > #### <font color='red'>1、condition 为 query,create,update,delete</font>
 >
-> #### <font color='red'>2、为了读写分离,serviceid还会变动,请不要写死</font>
+> #### <font color='red'>2、为了读写分离,serviceid 还会变动,请不要写死</font>
 >
-> #### <font color='red'>3、增删改查userId、groupCode必须传值,projectId、appId如果有需要传</font>
+> #### <font color='red'>3、增删改查 userId、groupCode 必须传值,projectId、appId 如果有需要传</font>
 >
 > #### <font color='red'>4、请求方式:POST</font>
 >
-> #### <font color='red'>5、IP端口号: 39.102.54.110:8081/org</font>
+> #### <font color='red'>5、IP 端口号: 39.102.54.110:8081/org</font>
 >
 > #### <font color='red'>6、create,update,delete 返回值格式 </font>
 >
->
 > ```json
 > {
->    "result": "success",
->      "data": {
->          "ids": [
->              "5c1e17",
->              "727591"
->          ]
->      }
+>     "result": "success",
+>     "data": {
+>         "ids": ["5c1e17", "727591"]
+>     }
 > }
 > ```
 
@@ -33,7 +29,7 @@
 
 ### 集团(<font color='red'>只提供查询接口</font>)
 
-请求路径:/group/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/group/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -52,9 +48,24 @@
 }
 ```
 
+<font color='red'>临时创建接口(后续版本会删除) </font>
+请求路径:/group/admin/create?userId=用户 id&groupCode=集团编码
+
+请求参数:
+
+```json
+查询字段:
+{
+  "id": "1",
+  "code": "WD",
+  "name": "万达",
+  "remark": "测试数据"
+}
+```
+
 ### 公司
 
-请求路径:/company/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/company/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -102,11 +113,12 @@
   "id": "1"
 }]
 ```
+
 ### 项目
 
-<font color='red'>注:项目id、name不能重复</font>
+<font color='red'>注:项目 id、name 不能重复</font>
 
-请求路径:/project/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/project/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -139,11 +151,12 @@
   "id": "1"
 }]
 ```
+
 ### 人员账号
 
-<font color='red'>支持用companyIds或deptIds查询人员,companyIds与deptIds同时传值,取companyIds自动忽略deptIds,companyIds与deptIds为数组:"companyIds": ["",""]、 "deptIds": ["",""]</font>
+<font color='red'>支持用 companyIds  deptIds 查询人员,companyIds  deptIds 同时传值,取 companyIds 自动忽略 deptIds,companyIds  deptIds 为数组:"companyIds": ["",""]、 "deptIds": ["",""]</font>
 
-请求路径:/user/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/user/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -221,9 +234,10 @@
 	}
 ]
 ```
+
 ### 部门
 
-请求路径:/dept/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/dept/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -284,9 +298,9 @@
 
 ### 部门分类
 
-<font color='red'>注:code、name不可重复</font>
+<font color='red'>注:code、name 不可重复</font>
 
-请求路径: /dept/classify/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径: /dept/classify/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -328,9 +342,10 @@
   "id": "1"
 }]
 ```
+
 ### 岗位
 
-请求路径:/job/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/job/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -379,9 +394,10 @@
   "id": "1"
 }]
 ```
+
 ### 岗位分类
 
-请求路径:/job/classify/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/job/classify/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -429,7 +445,7 @@
 
 ### 应用(<font color='red'>只提供查询接口</font>)
 
-请求路径:/application/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/application/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -453,9 +469,10 @@
   "remark": "测试数据"
 }
 ```
+
 ### 功能(<font color='red'>只提供查询接口</font>)
 
-请求路径:/function/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/function/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -482,9 +499,10 @@
   "remark": "测试数据"
 }
 ```
+
 ### 岗位分类与应用功能关系
 
-请求路径:/job/classify/rel/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/job/classify/rel/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -528,7 +546,7 @@
 
 ### 集团与应用的关系
 
-请求路径:/group/app/rel/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/group/app/rel/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -574,7 +592,7 @@
 
 ### 集团与功能的关系
 
-请求路径:/group/function/rel/{condition}?userId=用户id&groupCode=集团编码&projectId=项目Id&appId=应用id
+请求路径:/group/function/rel/{condition}?userId=用户 id&groupCode=集团编码&projectId=项目 Id&appId=应用 id
 
 请求参数:
 
@@ -617,4 +635,3 @@
   }
 ]
 ```
-

+ 6 - 6
docs/rwd/iot.md

@@ -26,9 +26,9 @@ POST: /rwd/iot/data/current
 
 ```
 [
-    { "objectId": "Eqxxxxx", "infoCode": "Tdb" },
-    { "objectId": "Eqxxxxx", "infoCode": "CO2" },
-    { "objectId": "Eqxxxxx", "infoCode": "Hcho" }
+    { "objectId": "Eqxxxxx", "infoCode": "tdb" },
+    { "objectId": "Eqxxxxx", "infoCode": "co2" },
+    { "objectId": "Eqxxxxx", "infoCode": "hcho" }
 ]
 ```
 
@@ -40,21 +40,21 @@ POST: /rwd/iot/data/current
     "data": [
         {
             "objectId": "Eqxxxxx",
-            "infoCode": "Tdb",
+            "infoCode": "tdb",
             "infoValue": "8000-123",
             "data": 25.6,
             "time": "20200512172435"
         },
         {
             "objectId": "Eqxxxxx",
-            "infoCode": "Tdb",
+            "infoCode": "tdb",
             "infoValue": "8000-123",
             "data": 25.6,
             "time": "20200512172435"
         },
         {
             "objectId": "Eqxxxxx",
-            "infoCode": "Tdb",
+            "infoCode": "tdb",
             "error": "错误信息:信息点不存在,表号功能号配置错误,断数等"
         }
     ]

+ 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"
+    }
+}
+
+```