Skip to content

知识库

获取知识库列表

GET /plugins/knowledge_base/knowledge_bases

权限

  • 需要认证

请求参数

名称位置类型必选说明
conditionsquerystringfalsenone
sortquerystringfalse排序字段
offsetquerystringfalse分页偏移值, 默认0
limitquerystringfalse每一页数量, 默认10

响应

json
{
    "data": [
        {
            "id": "15",
            "title": "111",
            "summary": "",
            "status": "published",
            "likeNum": "0",
            "favoriteNum": "1",
            "showable": "open",
            "updatedTime": "2020-12-09T11:54:20+08:00",
            "owners": {
                "id": "2",
                "nickname": "admin",
                "title": "首席讲师事实上",
                "loginTime": "1615944945",
                "hireDate": "0",
                "uuid": "c3a59fde919898131b8e4e99b7473ad960a86efd",
                "truename": "AshleyAAAAA",
                "avatar": {
                    "small": "http://qa2.edusoho.cn/files/user/2019/03-19/173618248f95570345.png",
                    "middle": "http://qa2.edusoho.cn/files/user/2019/03-19/173618247f42280607.png",
                    "large": "http://qa2.edusoho.cn/files/user/2019/03-19/173618246a23910880.png"
                }
            },
            "updatedUser": {
                "id": "1211",
                "nickname": "yisanna",
                "title": "测试",
                "loginTime": "1615945967",
                "hireDate": "0",
                "uuid": "129812d5eb38f1e94c6d504433235e02e50754d9",
                "truename": "yisannayisannay",
                "avatar": {
                    "small": "http://qa2.edusoho.cn/files/default/2020/07-15/094521131725426337.jpg",
                    "middle": "http://qa2.edusoho.cn/files/default/2020/07-15/094521130261328613.jpg",
                    "large": "http://qa2.edusoho.cn/files/default/2020/07-15/09452112ee60915196.jpg"
                }
            },
            "category": {
                "id": "512",
                "name": "分类1"
            },
            "knowledgeNum": "5",
            "hitNum": "25",
            "fileSize": [
                "248.2",
                "KB"
            ],
            "fileNum": "4",
            "isSubscribe": 0,
            "memberNum": "2"
        }
    ],
    "paging": {
        "total": 1,
        "offset": 0,
        "limit": 10
    }
}

参数说明

名称类型必选约束说明
» idinteger(int64)falsenone知识库Id
» titlestringfalsenone标题
» summarystringfalsenone简介
» likeNuminteger(int64)falsenone点赞数
» favoriteNuminteger(int64)falsenone收藏数
» knowledgeNuminteger(int64)falsenone知识数量
» hitNuminteger(int64)falsenone访问数量
» fileSizearrayfalsenone文件总量
»» 0integer(int64)falsenone文件大小
»» 1stringfalsenone文件大小单位
» fileNuminteger(int64)falsenone文件数量
» memberNuminteger(int64)falsenone订阅数量
» isSubscriptioninteger(int64)falsenone当前用户是否订阅
» categoryarrayfalsenonenone
»» idinteger(int64)falsenone分类ID
»» namestringfalsenone分类名称
» ownerarrayfalsenonenone
»» uuidstringfalsenonenone
»» nicknamestringfalsenonenone
»» truenamestringfalsenonenone
» updatedUserarrayfalsenonenone
» updatedTimeinteger(int64)falsenonenone

获取知识库信息

GET /plugins/knowledge_base/knowledge_bases/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

json
{
    "id": "15",
    "title": "111",
    "summary": "",
    "status": "published",
    "likeNum": "0",
    "favoriteNum": "1",
    "showable": "open",
    "updatedTime": "2020-12-09T11:54:20+08:00",
    "org": {
        "id": "1",
        "name": "测试企业微信",
        "code": "FullSite"
    },
    "knowledgeNum": "5",
    "hitNum": "25",
    "fileSize": [
        "248.2",
        "KB"
    ],
    "updatedUser": {
        "id": "1211",
        "nickname": "yisanna",
        "title": "测试",
        "loginTime": "1615945967",
        "hireDate": "0",
        "uuid": "129812d5eb38f1e94c6d504433235e02e50754d9",
        "truename": "yisannayisannay",
        "avatar": {
            "small": "http://qa2.edusoho.cn/files/default/2020/07-15/094521131725426337.jpg",
            "middle": "http://qa2.edusoho.cn/files/default/2020/07-15/094521130261328613.jpg",
            "large": "http://qa2.edusoho.cn/files/default/2020/07-15/09452112ee60915196.jpg"
        }
    },
    "category": {
        "id": "512",
        "name": "分类1"
    },
    "manageRole": "admin",
    "isSubscribe": 0,
    "owners": {
        "id": "2",
        "nickname": "admin",
        "title": "首席讲师事实上",
        "loginTime": "1615944945",
        "hireDate": "0",
        "uuid": "c3a59fde919898131b8e4e99b7473ad960a86efd",
        "truename": "AshleyAAAAA",
        "avatar": {
            "small": "http://qa2.edusoho.cn/files/user/2019/03-19/173618248f95570345.png",
            "middle": "http://qa2.edusoho.cn/files/user/2019/03-19/173618247f42280607.png",
            "large": "http://qa2.edusoho.cn/files/user/2019/03-19/173618246a23910880.png"
        }
    },
    "managers": [],
    "authors": [],
    "publishOrg": [],
    "publishPost": [],
    "publishUserGroup": [],
    "publishPostRank": []
}

参数说明

名称类型必选约束说明
idinteger(int64)falsenonenone
titlestringfalsenonenone
summarystringfalsenonenone
likeNuminteger(int64)falsenone点赞数量
favoriteNuminteger(int64)falsenone收藏数量
knowledgeNuminteger(int64)falsenone知识数量
hitNuminteger(int64)falsenone访问数量
fileSizeFileSizefalsenone文件总量
orgOrgfalsenonenone
categoryIdstringfalsenonenone
isSubscriptioninteger(int64)falsenone当前用户是否订阅
ownerUserfalsenonenone
managers[User]falsenonenone
authors[User]falsenonenone
showablestringfalsenonenone
visible_org[string]falsenone发布范围-组织机构
visible_post[string]falsenone发布范围-岗位
visible_user_group[string]falsenone发布范围-用户组
visible_post_rank[string]falsenone发布范围-职级
updatedTimeinteger(int64)falsenonenone

更新知识库信息

PATCH ​/plugins​/knowledge_base​/knowledge_bases​/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone
titlebodystringtrue标题
summarybodystringtrue简介
orgIdbodyinteger(int64)true所属部门
categoryIdbodyinteger(int64)false知识库分类
ownerIdsbody[string]false负责人
managerIdsbody[string]false管理组
authorIdsbody[string]false作者组
showablebodystringtrue发布范围类型
visible_orgbody[string]false发布范围-组织机构
visible_postbody[string]false发布范围-岗位
visible_user_groupbody[string]false发布范围-用户组
visible_post_rankbody[string]false发布范围-职级

响应

json
    {
      "success": true
    }

获取订阅名单列表

GET /plugins/knowledge_base/knowledge_bases/{id}/members

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone
postIdquerystringfalse岗位
usernamequerystringfalse姓名/用户名
sortquerystringfalse排序字段
offsetquerystringfalse分页偏移值, 默认0
limitquerystringfalse每一页数量, 默认10

响应

json
{
    "data": [
        {
            "id": "2608",
            "knowledgeBaseId": "1",
            "userId": "882",
            "createdUserId": "882",
            "createdTime": "2020-12-22T14:40:47+08:00",
            "nickname": "wangcaijuan",
            "truename": "",
            "post": {
                "id": "116",
                "name": "11",
                "code": "11145634563"
            },
            "orgs": [
                {
                    "id": "1",
                    "name": "测试企业微信",
                    "code": "FullSite"
                }
            ]
        },
        {
            "id": "1969",
            "knowledgeBaseId": "1",
            "userId": "272",
            "createdUserId": "272",
            "createdTime": "2020-12-07T23:52:44+08:00",
            "nickname": "金XX",
            "truename": "金XX",
            "post": {
                "id": "116",
                "name": "11",
                "code": "11145634563"
            },
            "orgs": [
                {
                    "id": "1",
                    "name": "测试企业微信",
                    "code": "FullSite"
                }
            ]
        }
    ],
    "paging": {
        "total": 2,
        "offset": 0,
        "limit": 10
    }
}

参数说明

名称类型必选约束说明
» idinteger(int64)falsenonenone
» nicknamestringfalsenonenone
» truenamestringfalsenonenone
» orgs[Org]falsenonenone
»» idinteger(int64)falsenonenone
»» codestringfalsenonenone
»» namestringfalsenonenone
» post[Post]falsenonenone
»» idinteger(int64)falsenonenone
»» namestringfalsenonenone
»» codestringfalsenonenone
» createdTimeinteger(int64)falsenonenone

订阅知识库

POST /plugins/knowledge_base/knowledge_bases/{id}/members

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

{
    "success": true
}

取消订阅

DELETE /plugins/knowledge_base/knowledge_bases/{id}/members

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

{
    "success": true
}