设备知识库
[TOC]
# [知识库接口]
> 状态说明
status: 0(已创建) 1(已修改)2(待审核) 3 (已处理)4(进入知识库)
## 1. /equipment/list
#### 接口功能
> 设备知识库列表
#### 请求方式
> GET
###### 请求参数
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|startDate|false|string|开始时间[yyyy-MM-dd (HH:mm:ss)]|
|endDate|false|String|结束时间[yyyy-MM-dd (HH:mm:ss)]|
|title|false|String|标题查询|
|type|false|Integer|类型查询(0 自己创建 1 应急维修 2 工单)|
|workType|false|String|工单类型|
|page|false|Int|分页(0 开始)|
|size|false|Int|页数|
|sort|false|string|排序(sort=xx,desc&sort=xx,asc)|
###### 结果
```json
{
"status": 200,
"message": "",
"error": "",
"error_description": "",
"timestamp": 1583649632474,
"data": {
"content": [
{
"id": "1236541379910914049",
"title": "填求",
"treeSort": 1,
"status": null,
"type": 0,
"content": "",
"viewNum": 0,
"createDate": "2020-03-08 14:36:52",
"createBy": "admin",
"createByName": "admin",
"updateDate": "2020-03-08 14:36:52",
"updateBy": "admin",
"updateByName": "admin",
"contentDetail": {
"1": [
{
"ext": [
{
"id": "1.1.1",
"title": "dfsdf",
"content": ""
}
],
"id": "1.1",
"title": "fsdfs",
"content": "fdfs"
},
{
"id": "1.2",
"title": "fsdf",
"content": "fsdfs"
}
],
"2": [
{
"id": "2.1",
"title": "ff",
"content": "fsdfsf"
}
]
}
}
],
"pageable": {
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"offset": 0,
"pageSize": 20,
"pageNumber": 0,
"paged": true,
"unpaged": false
},
"totalPages": 1,
"totalElements": 1,
"last": true,
"number": 0,
"size": 20,
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"numberOfElements": 1,
"first": true,
"empty": false
}
}
```
----------
## 2. /equipment
#### 接口功能
> 设备知识库添加
#### 请求方式
> POST
###### 请求参数
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|title|ture|string|标题|
|status|true|String|状态|
|type|true|integer|类型 0 自己添加 1.维修 2.工单|
|factory|false|String|工厂名|
|factoryCode|false|String|工厂编码|
|office|false|String|公司名|
|officeCode|false|String|公司编码|
|content|true|String|内容|
|contentDetail|true|JSON|内容(content contentDetail 任选其一)|
###### 请求例子
```
curl -X POST http://127.0.0.1:8096/equipment
-d '{
"title":"填求",
"type":0,
"contentDetail":{
"1": [
{
"title": "1"
}
],
"2": [
{
"ext": [
{
"title": "2.1"
},
{
"title": "2.2"
}
],
"title": "2"
}
]
}
}'
```
----------
## 3. /equipment
#### 接口功能
> 设备知识库修改
#### 请求方式
> patch
###### 请求参数
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|id|ture|string|ID|
|title|false|string|标题|
|status|false|String|状态|
|type|false|integer|类型 0 自己添加 1.维修 2.工单|
|content|false|String|内容|
###### 请求例子
```
curl -X PATCH http://127.0.0.1:8096/equipment
-d '{
"id":"13124341",
"title":"填求",
"type":0,
"content":"\"1\":[{\"id\":\"1.1\",\"title\":\"fsdfs\",\"content\":\"fdfs\",\"ext\":[{\"id\":\"1.1.1\",\"title\":\"dfsdf\",\"content\":\"\"}]},{\"id\":\"1.2\",\"title\":\"fsdf\",\"content\":\"fsdfs\"}],\"2\":[{\"id\":\"2.1\",\"title\":\"ff\",\"content\":\"fsdfsf\"}]"
}'
```
-------
## 4. /equipment/{id}
#### 接口功能
> 设备知识库删除
{id} 设备知识库ID
#### 请求方式
> DELETE
###### 请求例子
```
curl -X DELETE http://127.0.0.1:8096/equipment/115569298869486387
```
## 5. /fuzzy
#### 接口功能
> 标题列表模糊查询
title 标题
#### 请求方式
> GET
###### 请求例子
```
curl -X GET http://127.0.0.1:8096/equipment/fuzzy?title=xxx
```
## 6. /equipment/config
#### 接口功能
> 设备知识角色权限添加
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|roleId|ture|string|角色ID|
|roleName|ture|string|角色名称|
|operate|true|权限| 0 增加 1 审核|
|type|true|integer|类型 0 自己添加 1.维修 2.工单|
|workType|false|String|工单类型(电气 、其他 、机械 、仪表 )|
|factory|false|String|工厂名|
|factoryCode|false|String|工厂编码|
|office|false|String|公司名|
|officeCode|false|String|公司编码|
#### 请求方式
> POST application/json
> POST application/json 辅助参数 url?batch
###### 请求例子
```
curl -X POSThttp://127.0.0.1:8096/equipment/config
-d'
{
"type":1,
"roleId":"003",
"workType":"电气",
"operate":"1"
}'
curl -X POSThttp://127.0.0.1:8096/equipment/config?batch
-d '
[{
"type":1,
"roleId":"003",
"workType":"电气",
"operate":"1"
},
{
"type":1,
"roleId":"003",
"workType":"电气",
"operate":"1"
}]'
```
## 7. /equipment/config
#### 接口功能
> 设备知识角色配置 启用 禁用
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|type|true|integer|类型 0 自己添加 1.维修 2.工单|
|workType|true|String|工单类型|
|status|true|状态| 0 正常 1 禁用|
#### 请求方式
> PATCH application/json
> PATCH application/json url?batch
###### 请求例子
```
curl -X PATCH http://127.0.0.1:8096/equipment/config
-d'
{
"type":0,
"workType":"",
"status":0
}'
```
## 8. /equipment/config
#### 接口功能
> 设备知识库权限删除
|参数|必选|类型|说明|
|:----- |:-------|:-----|:-----|
|type|ture|Integer|类型|
|workType|true|String|工单类型|
#### 请求方式
> DELETE
###### 请求例子
```
curl -X DELETE http://127.0.0.1:8096/equipment/config -d {
"type": 0,
"workType":""
}
```
## 9. /equipment/config
#### 接口功能
> 获取权限配置列表
#### 请求方式
> GET
###### 请求例子
```
curl -X GET http://127.0.0.1:8096/equipment/config
```