知识库接口
<h1>1.orientdb创建表结构</h1>
<pre><code>delete vertex FROM BasicCatalog;
delete vertex FROM BasicCatalogPermission;
delete vertex FROM BasicKnowledgeThumbsOrCollect;
delete vertex FROM BasicKnowledgeSearchKeyword;
delete vertex FROM BasicKnowledgeComment;
创建Class
BasicCatalog
BasicCatalogPermission
BasicKnowledgeThumbsOrCollect
BasicKnowledgeSearchKeyword
BasicKnowledgeComment
创建关系
BasicCatalogPermissionRelationship from:BasicCatalog to:BasicCatalogPermission
BasicKnowledgeCommentUserRelationship from:BasicCatalog to:BasicKnowledgeComment
BasicKnowledgeThumbsOrCollectUserRelationship from:BasicKnowledgeThumbsOrCollect to:BasicUser
使用put方法加字段
knowledge_index/_mapping/_doc
{
"properties": {
"state":{
"type": "keyword"
}
}
}
</code></pre>
<h1>1.知识分类</h1>
<h2>1.1知识分类新增</h2>
<p>接口地址<code>http://192.168.2.107:8080/ops/knowledge/catalog/add</code>
参数</p>
<pre><code>{
"parentId":"",
"name":"测试0111",
"sort":5,
"inheritPermission":true
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610354049868,
"responseBody": null
}</code></pre>
<h2>1.2知识分类修改</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/update</code>
参数</p>
<pre><code>{
"uuid":"502bcfb2c4f74e5589cc77e176b19cdd",
"name":"测试011102",
"parentId":"",
"sort":5
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610354452428,
"responseBody": null
}</code></pre>
<h2>1.3知识分类删除</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/delete</code>
参数</p>
<pre><code>{
"uuid":"502bcfb2c4f74e5589cc77e176b19cdd"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610354591041,
"responseBody": null
}</code></pre>
<h2>1.4知识分类树</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getTree</code>
返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610353777176,
"responseBody": [
{
"uuid": "3590c520ef6f42af8ee1282171de34c0",
"parentId": "",
"parentName": null,
"name": "one",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "3baee4e5e6db4a2d9d78ae13652d1408",
"parentId": "3590c520ef6f42af8ee1282171de34c0",
"parentName": "one",
"name": "one2",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "d3e9648fe8814910a7f7334d0003d764",
"parentId": "3baee4e5e6db4a2d9d78ae13652d1408",
"parentName": "one2",
"name": "测试",
"sort": 0,
"count": 0,
"children": null
}
]
}
]
},
{
"uuid": "873d0e1d36834b2cbeff574361692c96",
"parentId": null,
"parentName": null,
"name": "测试2",
"sort": 0,
"count": 0,
"children": null
}
]
}</code></pre>
<h2>1.5知识分类授权保存(更新和新增都用同一个接口)</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/savePermission</code>
参数,更新的时候传uuid</p>
<pre><code>{
"uuid":"87ddf1e597a14932a00aced4c1f9c700",
"catalogId":"37f781cecbc24d59b5b3619c0451ad67",
"departmentQuery":[""],
"departmentOperate":[],
"roleQuery":["83fcfb4ea7cc4337b8e072036a1b32ea","dbefefce33a94c4daa7c01c55afeb780"],
"roleOperate":["administratorRole","dbefefce33a94c4daa7c01c55afeb780"],
"userQuery":["e2814abd2aa848e8a310cb97bc36b1e4"],
"userOperate":["39bca7e88d4b487cbf53fe56a5710375"],
"approver":["e2814abd2aa848e8a310cb97bc36b1e4"]
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610355930464,
"responseBody": null
}</code></pre>
<h2>1.6知识分类授权查看</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getPermission</code>
参数</p>
<pre><code>{
"catalogId":"37f781cecbc24d59b5b3619c0451ad67"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610356530058,
"responseBody": {
"uuid": "87ddf1e597a14932a00aced4c1f9c700",
"departmentQuery": [
""
],
"departmentOperate": [],
"roleQuery": [
"83fcfb4ea7cc4337b8e072036a1b32ea",
"dbefefce33a94c4daa7c01c55afeb780"
],
"roleOperate": [
"administratorRole",
"dbefefce33a94c4daa7c01c55afeb780"
],
"userQuery": [
"e2814abd2aa848e8a310cb97bc36b1e4"
],
"userOperate": [
"39bca7e88d4b487cbf53fe56a5710375"
],
"approver": [
"e2814abd2aa848e8a310cb97bc36b1e4"
],
"catalogId": "37f781cecbc24d59b5b3619c0451ad67"
}
}</code></pre>
<h2>1.7知识库分类授权列表</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getPermissionValue</code>
参数</p>
<pre><code>{
"catalogId":"2e8e63b102b14b31a557e0083beee809"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611747157655,
"responseBody": {
"uuid": null,
"departmentQuery": [],
"departmentOperate": [],
"roleQuery": [
"知识审核",
"知识经理"
],
"roleOperate": [
"超级管理员",
"知识经理"
],
"userQuery": [
"quwh"
],
"userOperate": [
"wuhao"
],
"approver": [
"quwh"
],
"catalogId": null
}
}</code></pre>
<h1>2.知识库维护+我的知识库</h1>
<h2>2.1启用知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/enableKnowledge</code>
参数</p>
<pre><code>{
"uuid":"ab3cd9d497054a8280f2a808437553b4"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446480729,
"responseBody": null
}</code></pre>
<h2>2.1新增知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/add</code>
参数</p>
<pre><code>{
"title":"33333333333333",
"words":"测2222试",
"catalogId":"3590c520ef6f42af8ee1282171de34c0,3baee4e5e6db4a2d9d78ae13652d1408,d3e9648fe8814910a7f7334d0003d764",
"content":"222222222222222222222222222222222",
"createUserId":"a568c14c289e4404ab9506ba658fb07b",
"createUser":"系统管理员",
"createTime":"2021-01-12 16:32:42",
"createDept":"3121b46be7984b3ea95bbe2a76b1ca03"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446131290,
"responseBody": null
}</code></pre>
<h2>2.3删除知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/delete</code>
参数</p>
<pre><code>{
"uuid":"ab3cd9d497054a8280f2a808437553b4"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446480729,
"responseBody": null
}</code></pre>
<h2>2.4准备删除知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/prepareDeleteKnowledge</code>
参数</p>
<pre><code>{
"uuid":""
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446480729,
"responseBody": null
}
</code></pre>
<h2>2.5准备编辑知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/prepareUpdateKnowledge</code>
参数</p>
<pre><code>{
"uuid":""
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446480729,
"responseBody": null
}
</code></pre>
<h2>2.6更新知识</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/updateKnowledge</code>
参数</p>
<pre><code>{
"title":"33333333333333",
"words":"测2222试",
"catalogId":"3590c520ef6f42af8ee1282171de34c0,3baee4e5e6db4a2d9d78ae13652d1408,d3e9648fe8814910a7f7334d0003d764",
"content":"222222222222222222222222222222222",
"createUserId":"a568c14c289e4404ab9506ba658fb07b",
"createUser":"系统管理员",
"createTime":"2021-01-12 16:32:42",
"createDept":"3121b46be7984b3ea95bbe2a76b1ca03",
"updateTime":"2021-01-26 16:32:42",
"state":"启用"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610446480729,
"responseBody": null
}
</code></pre>
<h2>2.4知识详情页</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/getKnowledgeByUuid</code>
参数</p>
<pre><code>{
"uuid":"ef5813dd-611b-11eb-bd15-00ff0db12b40"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611892857799,
"responseBody": {
"uuid": "ef5813dd-611b-11eb-bd15-00ff0db12b40",
"title": "合同取消按钮逻辑优化以及合同修改",
"words": null,
"catalogId": "事件流程",
"catalogFullId": "",
"catalogName": null,
"content": "合同编号:320113WZ0520190002,将该合同状态修改为:YPZ等待法务推送未签订结果回来后,再将该合同状态修改为YQX程序修改:合同取消按钮,在YPZ状态下无法使用,在WQD状态下可用。(基于法务上线后需调整,原流程执行有问题)",
"attachment": null,
"createUserId": null,
"createUser": null,
"createTime": null,
"createDept": "事业部本部",
"updateTime": null,
"state": "启用",
"operate": false,
"readCount": 0,
"commentCount": 0,
"thumbsCount": 0,
"collectCount": 0,
"collected": false,
"thumbsed": false
}
}</code></pre>
<h3>2.4.1点赞或者收藏</h3>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/thumbsOrCollect</code>
参数【type: thumbs|collect】</p>
<pre><code>{
"type":"thumbs",
"knowledgeUuid":"d0954c95fcbb457ba54ca7eb75a0f4db",
"userId":"e2814abd2aa848e8a310cb97bc36b1e4" //可选,默认从登陆信息拿
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610417095341,
"responseBody": {
"count": 1,
"exitsThumbsOrCollect": true,
"type": "thumbs"
}
}</code></pre>
<h3>2.4.2 取消点赞或者收藏</h3>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/cancelThumbsOrCollect</code>
参数【type: thumbs|collect】</p>
<pre><code>{
"type":"thumbs",
"knowledgeUuid":"d0954c95fcbb457ba54ca7eb75a0f4db",
"userId":"e2814abd2aa848e8a310cb97bc36b1e4" //可选,默认从登陆信息拿
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610417891206,
"responseBody": {
"count": 0,
"exitsThumbsOrCollect": false,
"type": "collect"
}
}</code></pre>
<h3>2.4.3评论列表</h3>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/getCommentList</code>
参数:知识ID</p>
<pre><code>{
"uuid":"b927351427a345af968b2e3e022cfa36"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610435640370,
"responseBody": [
{
"uuid": "5dd5199604d247558c8bf0e016b91d9c",
"createTime": "2021-01-12 15:11:46",
"content": "4",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "",
"children": null
},
{
"uuid": "6124f48e592b418cb230a7907beb39b5",
"createTime": "2021-01-12 15:10:04",
"content": "3",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": null,
"children": [
{
"uuid": "3400444aa7124f72a79df190c08b4189",
"createTime": "2021-01-12 15:13:21",
"content": "3.1",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "6124f48e592b418cb230a7907beb39b5",
"children": null
}
]
},
{
"uuid": "51a0da70cc6d4329998769c5eb2d08bd",
"createTime": "2021-01-12 15:09:59",
"content": "2",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": null,
"children": null
},
{
"uuid": "7cee394721e54e308861f30a58a32443",
"createTime": "2021-01-12 15:09:53",
"content": "1",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": null,
"children": [
{
"uuid": "a4d0898d62ce4b008c393e655fa47518",
"createTime": "2021-01-12 15:13:06",
"content": "1.1.1.1",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "dfc9411b4ffe4772b3d059393d77e7f8",
"children": null
},
{
"uuid": "dfc9411b4ffe4772b3d059393d77e7f8",
"createTime": "2021-01-12 15:12:42",
"content": "1.1.1",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "de723219c85b41179db4c4739831b66a",
"children": null
},
{
"uuid": "7813a141f09648d38a22562ca413e860",
"createTime": "2021-01-12 15:12:19",
"content": "1.2",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "7cee394721e54e308861f30a58a32443",
"children": null
},
{
"uuid": "de723219c85b41179db4c4739831b66a",
"createTime": "2021-01-12 15:12:10",
"content": "1.1",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "7cee394721e54e308861f30a58a32443",
"children": null
}
]
}
]
}</code></pre>
<h3>2.4.4发表评论+回复评论</h3>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/comment</code>
参数:parentCommentUuid 可选</p>
<pre><code>{
"content":"3333333333333",
"knowledgeUuid":"d0954c95fcbb457ba54ca7eb75a0f4db",
"userId":"e2814abd2aa848e8a310cb97bc36b1e4",
"parentCommentUuid":"08419fd140b14000854fd3207a793652",
"parentCommentUserId":"",
"knowledgeCreateUserId":"知识创建人ID"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610422632553,
"responseBody": [
{
"uuid": "4b93615ad88f41a6a3863eaee05366ee",
"createTime": "2021-01-12 10:55:56",
"content": "测试评论",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": null,
"children": [
{
"uuid": "35d99f6748a44a409144d823ffe85ac3",
"createTime": "2021-01-12 11:04:49",
"content": "测试评2222论",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "4b93615ad88f41a6a3863eaee05366ee",
"children": null
},
{
"uuid": "08419fd140b14000854fd3207a793652",
"createTime": "2021-01-12 11:04:09",
"content": "测试评2222论",
"userId": "e2814abd2aa848e8a310cb97bc36b1e4",
"userName": "quwh",
"avatar": "null",
"parentCommentUuid": "4b93615ad88f41a6a3863eaee05366ee",
"children": null
}
]
}
]
}</code></pre>
<h2>2.5知识库维护目录树--同知识分类树</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getTree</code></p>
<h2>2.6我的知识库目录树</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getTreeByUser</code>
返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611815882225,
"responseBody": {
"uuid": "parent",
"parentId": null,
"parentName": null,
"name": "知识分类",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "myKnowledge",
"parentId": null,
"parentName": null,
"name": "我的知识库",
"sort": -1,
"count": 0,
"children": [
{
"uuid": "myCollectKnowledge",
"parentId": "myKnowledge",
"parentName": "我的知识库",
"name": "我的收藏",
"sort": 0,
"count": 0,
"children": null
},
{
"uuid": "myCreateKnowledge",
"parentId": "myKnowledge",
"parentName": "我的知识库",
"name": "我的创建",
"sort": 1,
"count": 0,
"children": null
}
]
},
{
"uuid": "2e8e63b102b14b31a557e0083beee809",
"parentId": null,
"parentName": null,
"name": "测试分类1",
"sort": 0,
"count": 3,
"children": null
}
]
}
}
</code></pre>
<h2>2.7知识导出</h2>
<p>接口地址<code>http://192.168.2.107:8080/ops/knowledge/knowledge/exportKnowledge</code>
请求方式 <code>POST</code>
参数</p>
<pre><code>{
"catalogId":"myKnowledge",
"keyword":"20211028"
}</code></pre>
<p>返回文件流</p>
<h3>2.8知识导入</h3>
<h4>2.8.1下载模板</h4>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/downloadTemplate</code></p>
<h4>2.8.2预导入</h4>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/importKnowledge</code>
参数:form-data</p>
<pre><code> file:文件</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611142893353,
"responseBody": {
"code": "90df80d85e6c4bcd9770e5bca50eeefa",
"fileName": "模板.xlsx",
"fileOK": true,
"message": null,
"totalNum": 6,
"successNum": 5,
"failNum": 1,
"successRows": [
[
{
"excelName": "标题(必填)",
"fieldName": "title",
"excelValue": "测试3",
"saveValue": "测试3",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "关键字",
"fieldName": "words",
"excelValue": "测试3",
"saveValue": "测试3",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "知识分类(必填)",
"fieldName": "catalogId",
"excelValue": "测试1",
"saveValue": "a06739ad7e1247fd94e89881e16f62c0",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "内容(必填)",
"fieldName": "content",
"excelValue": "测试2测试2测试2测试2测试2测试2",
"saveValue": "测试2测试2测试2测试2测试2测试2",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "创建人",
"fieldName": "createUserId",
"excelValue": "系统管理员",
"saveValue": "a568c14c289e4404ab9506ba658fb07b",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "创建部门",
"fieldName": "createDept",
"excelValue": "产品二部",
"saveValue": "3121b46be7984b3ea95bbe2a76b1ca03",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
},
{
"excelName": "创建时间",
"fieldName": "createTime",
"excelValue": "2021-01-12 10:47:42",
"saveValue": "2021-01-12 10:47:42",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 1
}
]
],
"failRows": [
[
{
"excelName": "标题(必填)",
"fieldName": "title",
"excelValue": "111",
"saveValue": "111",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
},
{
"excelName": "关键字",
"fieldName": "words",
"excelValue": "2222",
"saveValue": "2222",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
},
{
"excelName": "知识分类(必填)",
"fieldName": "catalogId",
"excelValue": "测试1",
"saveValue": "a06739ad7e1247fd94e89881e16f62c0",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
},
{
"excelName": "内容(必填)",
"fieldName": "content",
"excelValue": "xxxxxxxxxxxxquwh",
"saveValue": "xxxxxxxxxxxxquwh",
"isRequired": true,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
},
{
"excelName": "创建人",
"fieldName": "createUserId",
"excelValue": "e2814abd2aa848e8a310cb97bc36b1e4",
"saveValue": "e2814abd2aa848e8a310cb97bc36b1e4",
"isRequired": false,
"checkIsSuccess": false,
"checkMessage": "用户名不存在",
"rowNumber": 6
},
{
"excelName": "创建部门",
"fieldName": "createDept",
"excelValue": "产品二部",
"saveValue": "3121b46be7984b3ea95bbe2a76b1ca03",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
},
{
"excelName": "创建时间",
"fieldName": "createTime",
"excelValue": "2021-01-19 10:01:00",
"saveValue": "2021-01-19 10:01:00",
"isRequired": false,
"checkIsSuccess": true,
"checkMessage": null,
"rowNumber": 6
}
]
],
"successList": [
{
"createUserId": "系统管理员",
"catalogId": "测试1",
"createDept": "产品二部",
"createTime": "2021-01-12 10:47:42",
"words": "测试3",
"title": "测试3",
"content": "测试2测试2测试2测试2测试2测试2"
}
],
"failList": [
{
"createUserId": "e2814abd2aa848e8a310cb97bc36b1e4",
"catalogId": "测试1",
"createDept": "产品二部",
"createTime": "2021-01-19 10:01:00",
"words": "2222",
"title": "111",
"content": "xxxxxxxxxxxxquwh"
}
]
}
}
</code></pre>
<h4>2.8.3确认导入</h4>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/confirmImport</code>
参数</p>
<pre><code>{
"code":"90df80d85e6c4bcd9770e5bca50eeefa",
"fileName":"模板.xlsx"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611142933256,
"responseBody": null
}</code></pre>
<h4>2.8.4取消导入</h4>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/cancelImport</code>
参数</p>
<pre><code>{
"code":"90df80d85e6c4bcd9770e5bca50eeefa",
"fileName":"模板.xlsx"
}</code></pre>
<h2>2.9新消息(收到的赞、收到的回复)</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/getNewMessage</code>
返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1612420763178,
"responseBody": {
"commentList": [{
"read": 0,
"createTime": "2021-02-04 14:29:02",
"knowledgeTitle": "控件啊烧开后该能够举得手机",
"knowledgeUuid": "2dfa1e6e1cd0413488b7df3731fe0b66",
"userName": "系统管理员",
"uuid": "a2fcf9452a1f440887b3f1252c047b87",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "11111"
}, {
"read": 0,
"createTime": "2021-02-04 14:29:07",
"knowledgeTitle": "控件啊烧开后该能够举得手机",
"knowledgeUuid": "2dfa1e6e1cd0413488b7df3731fe0b66",
"userName": "系统管理员",
"uuid": "0bd6289f9ebb430c80fc7f7b5e09c8f8",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "21222"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:40",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "63099df9d91844ebb693bba249e1871a",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "1111"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:43",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "c6843d0093c14716a7b4a271c9bbd864",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "24414"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:45",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "b5d29b0bbcf94e89ab25db30e6a08db7",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "124141"
}],
"thumbsList": [{
"read": 0,
"createTime": "2021-02-04 14:28:33",
"knowledgeTitle": "控件啊烧开后该能够举得手机",
"type": "thumbs",
"knowledgeUuid": "2dfa1e6e1cd0413488b7df3731fe0b66",
"userName": "系统管理员",
"uuid": "5559dac21e55472e969df5f32556fd26",
"userId": "a568c14c289e4404ab9506ba658fb07b"
}, {
"read": 0,
"createTime": "2021-02-04 14:28:40",
"knowledgeTitle": "测试1",
"type": "thumbs",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "ed4795ec88bb4cfa83717dbe8ef5ca20",
"userId": "a568c14c289e4404ab9506ba658fb07b"
}],
"repliedCommentList": [{
"read": 0,
"createTime": "2021-02-04 14:29:02",
"knowledgeTitle": "控件啊烧开后该能够举得手机",
"knowledgeUuid": "2dfa1e6e1cd0413488b7df3731fe0b66",
"userName": "系统管理员",
"uuid": "a2fcf9452a1f440887b3f1252c047b87",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "11111"
}, {
"read": 0,
"createTime": "2021-02-04 14:29:07",
"knowledgeTitle": "控件啊烧开后该能够举得手机",
"knowledgeUuid": "2dfa1e6e1cd0413488b7df3731fe0b66",
"userName": "系统管理员",
"uuid": "0bd6289f9ebb430c80fc7f7b5e09c8f8",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "21222"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:40",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "63099df9d91844ebb693bba249e1871a",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "1111"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:43",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "c6843d0093c14716a7b4a271c9bbd864",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "24414"
}, {
"read": 0,
"createTime": "2021-02-04 14:38:45",
"knowledgeTitle": "测试1",
"knowledgeUuid": "de362b85240844d0a897418a289041b5",
"userName": "系统管理员",
"uuid": "b5d29b0bbcf94e89ab25db30e6a08db7",
"userId": "a568c14c289e4404ab9506ba658fb07b",
"content": "124141"
}]
},
"page": null
}</code></pre>
<h2>2.10更新消息为已阅</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/updateNewMessageState</code>
参数</p>
<pre><code>{
"thumbsUuids":[],
"commentUuids":[],
"repliedCommentUuids":[]
}</code></pre>
<h2>2.11列表</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/getByCatalogAndUser</code>
参数
备注:
特殊catalogId:parent,myKnowledge,myCreateKnowledge,myCollectKnowledge
排序字段sortField,name为点击排序的列对应的字段,sort可填 asc 或 desc</p>
<pre><code>{
"page":"1",
"limit":"10",
"keyword":"microsoft",
"catalogId":"parent",
"sortField":{"name":"createUser","sort":"asc"}
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611144712327,
"responseBody": {
"pageInfo": {
"page": 2,
"limit": 10,
"total": 11
},
"data": [
{
"uuid": "05bba92e0146433aa2cdbe8fda0cbb48",
"title": "111",
"words": "2222",
"knowledgeNumber":"",
"catalogId": "a06739ad7e1247fd94e89881e16f62c0",
"catalogFullId": "",
"catalogName": "测试1",
"content": "xxxxxxxxxxxxquwh",
"attachment": null,
"createUserId": null,
"createUser": "e2814abd2aa848e8a310cb97bc36b1e4",
"createTime": "2021-01-19 10:01:00",
"createDept": "3121b46be7984b3ea95bbe2a76b1ca03",
"readCount": 0,
"operate": false
}
]
}
}
</code></pre>
<h2>2.12知识阅读量</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/addReadCount</code>
参数</p>
<pre><code>{
"uuid":"05bba92e0146433aa2cdbe8fda0cbb48"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611145501295,
"responseBody": null
}
</code></pre>
<h2>2.13知识批量删除</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/batchDeleteKnowledgeByUuids</code>
参数</p>
<pre><code>{
"uuids":["5667f39d1102490db82f1262d375c159","78c78bf624b94f94a7cbf035d23a7631"]
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1615352506273,
"responseBody": null
}
</code></pre>
<h1>3.知识搜索</h1>
<h2>3.1知识分布 热搜关键字 知识库总览--知识总数、阅读量、今日新增</h2>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/knowledgeOverview</code>
返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1612230417219,
"responseBody": {
"knowledgeQuantityStatistics": {
"todayTotal": 0,
"total": 1,
"readCount": 19
},
"knowledgeDistribution": {
"process": {},
"knowledge": {
"A1": {
"catalogId": "25f56cf1b7f94d659ed01f9c1df3e766",
"count": 1
}
}
},
"keywords": []
}
}</code></pre>
<h2>3.5知识搜索</h2>
<h3>3.5.1知识总览树</h3>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getKnowledgeOverviewTree</code></p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1612316537011,
"responseBody": [
{
"uuid": "parent",
"parentId": null,
"parentName": null,
"name": "知识分类",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "e88d59b920e54270aa335a4de5cde1b4",
"parentId": "",
"parentName": null,
"name": "hy-1",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "2684e7cd877543ebb69125021ede9745",
"parentId": "e88d59b920e54270aa335a4de5cde1b4",
"parentName": "hy-1",
"name": "hy-12",
"sort": 20,
"count": 0,
"children": null
}
]
},
{
"uuid": "d17d78981059467c930fd6722f56aa78",
"parentId": "",
"parentName": null,
"name": "fzs",
"sort": 0,
"count": 6,
"children": [
{
"uuid": "f50d0a7929c146b9b7c7cee3032366a6",
"parentId": "d17d78981059467c930fd6722f56aa78",
"parentName": "fzs",
"name": "操作角色",
"sort": 0,
"count": 1,
"children": null
},
{
"uuid": "d41710a80b074de8ae6731322713c6f2",
"parentId": "d17d78981059467c930fd6722f56aa78",
"parentName": "fzs",
"name": "1",
"sort": 0,
"count": 0,
"children": null
},
{
"uuid": "2ad37e00b153482db29d8a21b492cb1d",
"parentId": "d17d78981059467c930fd6722f56aa78",
"parentName": "fzs",
"name": "2",
"sort": 0,
"count": 2,
"children": null
},
{
"uuid": "c4be7b6b5fa7420fa9f331e0756933f6",
"parentId": "d17d78981059467c930fd6722f56aa78",
"parentName": "fzs",
"name": "操作部门",
"sort": 0,
"count": 1,
"children": null
}
]
}
]
},
{
"uuid": "process",
"parentId": null,
"parentName": null,
"name": "流程",
"sort": 1,
"count": 0,
"children": []
}
]
}</code></pre>
<h5>排序:最新知识、最热知识、点赞最多、收藏最多、评论最多</h5>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/knowledge/getByCatalog</code>
参数
type:hot、thumbs、collect、comment、new 默认是new
searchType:knowledge,process 勾选知识库、流程</p>
<pre><code>{
"page":"1",
"limit":"10",
"keyword":"",
"catalogId":"",
"type":"hot",
"searchType":"knowledge,process"
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1611738889163,
"responseBody": {
"pageInfo": {
"page": 1,
"limit": 2,
"total": 85
},
"data": [
{
"uuid": "e1991320-48e8-11eb-bc31-5254006d7e0f",
"title": "",
"words": null,
"catalogId": "事件流程",
"catalogName": "事件流程",
"content": "",
"attachment": null,
"createUserId": "a568c14c289e4404ab9506ba658fb07b",
"createUser": "系统管理员",
"createTime": "2020-12-28 16:44:18",
"createDept": null,
"updateTime": null,
"state": "启用",
"operate": false,
"readCount": 0,
"commentCount": 0,
"thumbsCount": 0,
"collectCount": 0
},
{
"uuid": "ee8b6c30-45af-11eb-b833-5254006d7e0f",
"title": "",
"words": null,
"catalogId": "事件流程",
"catalogName": "事件流程",
"content": "",
"attachment": null,
"createUserId": "a568c14c289e4404ab9506ba658fb07b",
"createUser": "系统管理员",
"createTime": "2020-12-24 14:18:50",
"createDept": null,
"updateTime": null,
"state": "启用",
"operate": false,
"readCount": 0,
"commentCount": 0,
"thumbsCount": 0,
"collectCount": 0
}
]
}
}
</code></pre>
<h1>4.流程</h1>
<p>1.将需要开启同步的流程配置在 processConfig.json</p>
<pre><code>{
"事件流程":{
"table":"process_instance",
"processKey": "kfw200318105905138",
"title":"title",
"words":"event_type.label",
"content":"reasondescribe,businessinflunce",
"contentDesc":"故障描述,故障分析",
"createUserId":"reporter.value",
"createUser":"reporter.label",
"createTime":"creationtime",
"createDept":"",
"knowledgeNumber":"eventnumber",
"attachment": "describeattach"
}
}</code></pre>
<p>2.修改application.properties文件的配置</p>
<pre><code>processSync.enable = true</code></pre>
<p>3.流程表单中使用的目录树--返回个人有权限编辑的目录树结构</p>
<p>接口地址<code>192.168.2.107:8080/ops/knowledge/catalog/getOperateTreeByUser</code>
返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1610353777176,
"responseBody": [
{
"uuid": "3590c520ef6f42af8ee1282171de34c0",
"parentId": "",
"parentName": null,
"name": "one",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "3baee4e5e6db4a2d9d78ae13652d1408",
"parentId": "3590c520ef6f42af8ee1282171de34c0",
"parentName": "one",
"name": "one2",
"sort": 0,
"count": 0,
"children": [
{
"uuid": "d3e9648fe8814910a7f7334d0003d764",
"parentId": "3baee4e5e6db4a2d9d78ae13652d1408",
"parentName": "one2",
"name": "测试",
"sort": 0,
"count": 0,
"children": null
}
]
}
]
},
{
"uuid": "873d0e1d36834b2cbeff574361692c96",
"parentId": null,
"parentName": null,
"name": "测试2",
"sort": 0,
"count": 0,
"children": null
}
]
}
</code></pre>
<p><em>2021-12-07新增接口</em></p>
<h2>准备删除知识</h2>
<p>接口地址<code>http://192.168.2.107:8080/ops/knowledge/knowledge/batchPrepareDeleteKnowledge</code></p>
<p>调用类型:<code>POST</code>
参数</p>
<pre><code>{
"uuids":["8a28116a383148fcab927692384fc6a7","2379187b1ce3492badcefa74f074cdd7"]
}</code></pre>
<p>返回</p>
<pre><code>{
"errorCode": 0,
"message": "成功",
"time": 1638869095412,
"responseBody": null
}
</code></pre>