1. 根据文档编码和文档版本获取文档key

1.1. 基本信息

Path

POST http://building-bos.rickricks.com/bosfoundationservice/{buildingId}/prototype/query/uoDocDocument?noRelation=true

API描述

根据文档编码和文档版本获取文档key(用于文档显示)

1.2. 请求参数

Request Headers

参数名称 介绍 举例
Authorization 用户令牌 abc
Content-Type media type application/json

Path Param

参数名称 介绍 举例
buildingId 建筑id abc

Request Body

application/json

参数名称 类型 必需 介绍
code String Y 文档编码
revision String Y 文档版本
{
    "condition": [
         {
            "field": "bosclass",
            "operator": "==",
            "value": "uoDocDocument",
            "number": "false",
            "logic": "And"
        },
        {
            "field": "code",
            "operator": "==",
            "value": "{code}",
            "number": "false",
            "logic": "And"
        },
        {
            "field": "revision",
            "operator": "==",
            "value": "{revision}",
            "number": "false",
            "logic": "And"
        }
    ],
    "select": [
        "_key"
    ]
}

1.3. 返回内容

执行成功

{
    "message": "请求处理成功",
    "code": "SUCCESS",
    "data": {
        "data": [
            {
                "currentUserPermissions": "rwdc",
                "key": "0d72d27c753e49a18e88167199652522",
                "_key": "0d72d27c753e49a18e88167199652522"
            }
        ],
        "count": 1
    }
}

2. 模糊搜索建筑内的文档

2.1. 基本信息

Path

POST http://building-bos.rickricks.com/buildingservice/{buildingId}/data/search

API描述

搜索建筑中文档编码、名称包含搜索关键字的文档并返回。

2.2. 请求参数

Request Headers

参数名称 介绍 举例
Authorization token abc

Path Param

参数名称 介绍 举例
buildingId 建筑ID abc

Query Param

参数名称 必需 介绍 举例
type Y 搜索类型,值固定为“document” document
keyword Y 搜索关键字 abc
page Y 指定第几页,指定每页的记录数,值为正整数 1
per_page Y 指定每页的记录数,值为正整数 5

2.3. 返回内容

执行成功

{
    "message":"请求处理成功",
    "code":"SUCCESS",
    "data":{
        "document":{
            "count":2,  // 文档总数量
            "data":[{  // 文档数据
                "readable":true,
                "creator":"cdytest1",
                "fileName":"综合工房.dwg",
                "downloadable":true,
                "code":"D004",
                "_rev":"_YtbjRMq---",
                "_key":"491531a02f3b4c5c95b85173c27ec41d",
                "revision":"0",
                "guser":"users/9c1b07da57f4464f9e13124d6f305f62",
                "size":390880,
                "createTime":"1558928687695",
                "gtime":"1558928772854",
                "name":"综合工房",
                "guid":"491531a02f3b4c5c95b85173c27ec41d",
                "_id":"documents/491531a02f3b4c5c95b85173c27ec41d",
                "bosclass":"uoDocDocument",
                "gcreatetime":"1558928688667"}]
        }
    }
}

执行失败

  • keyword参数为空时
{
    "message": "搜索关键词必填",
    "code": "FAILURE",
    "data": null
}
  • type为空时
{
    "message": "搜索类型必填",
    "code": "FAILURE",
    "data": null
}
  • type值未按规范传入时
{
    "message": "搜索类型值错误",
    "code": "FAILURE",
    "data": null
}
  • 分页参数page、per_page类型错误时
{
    "message": "page:数值错误或者per_page:数值错误",
    "code": "PARAMETER_VALID_ERROR",
    "data": null
}

3. 获取指定文件夹下的文件夹及文档列表

3.1. 基本信息

Path

POST http://building-bos.rickricks.com/bosdocumentservice/{buildingId}/folders/folders&documents?noRelation=true

API描述

获取指定文件夹下的文件夹及文档列表

3.2. 请求参数

Request Headers

参数名称 介绍 举例
Authorization 用户令牌 abc
Content-Type 内容类型 application/json

Path Param

参数名称 介绍 举例
buildingId 建筑id abc

Request Body

application/json

{
    "key": "l1b2427fccb8447f84a8e996a2f5f731_doc", // 文档文件夹key
    "entity": "both", // 查询的类别,只查文件夹(folders),只查文档(documents),都查(both),    默认为both
    "page": 1, // 页数
    "per_page": 10, // 每页条数
    "sortby": "createTime",
    "order": "desc",
    "nestOr": null
}

3.3. 返回内容

执行成功

{
    "message": "请求处理成功",
    "code": "SUCCESS",
    "data": {
        "per_page": 10,
        "data": [
            {
                "bosclass": "uoDocFolder",
                "code": "5XhtFzPDj4mH6ITSewTtzp",
                "currentUserPermissions": "rwdc",
                "gcreatetime": "1573108130355",
                "gdataType": "folders",
                "gtime": "1573108140534",
                "guser": "users/a9eda0ae03064874b74268541e49c923",
                "key": "a784572c8ae546d2bfb4f0cc0a380a66",
                "leaf": true,
                "level": 2,
                "longCode": "l1b2427fccb8447f84a8e996a2f5f731_doc※a784572c8ae546d2bfb4f0cc0a380a66",
                "longName": "文档管理根节点※cc1",
                "name": "cc1",
                "order": 1,
                "parentId": "l1b2427fccb8447f84a8e996a2f5f731_doc",
                "permissionGroup": [],
                "size": 9530
            },
            {
                "bosclass": "uoDocDocument",
                "code": "0UiOp4ufzPampPpWc2yt",
                "createTime": "1573108121454",
                "creator": "zhaobing",
                "currentUserPermissions": "rwdc",
                "fileName": "css(1).css",
                "gLongCode": "l1b2427fccb8447f84a8e996a2f5f731_doc",
                "gLongName": "文档管理根节点",
                "gcreatetime": "1573108121880",
                "gdataType": "documents",
                "gtime": "1573108121880",
                "guser": "users/a9eda0ae03064874b74268541e49c923",
                "key": "a41754d6842e4d0eb7ae8ceee9ca63c9",
                "name": "css(1)",
                "revision": "0",
                "size": 70238
            }
        ],
        "count": 2,
        "page": 1
    }
}

4. 在指定文件夹下按文档编码、名称模糊搜索文档

4.1. 基本信息

Path

POST http://building-bos.rickricks.com/bosfoundationservice/{buildingId}/prototype/linked/query?page=1&per_page=10

API描述

在指定文件夹下按文档编码、名称模糊搜索文档

4.2. 请求参数

Request Headers

参数名称 介绍 举例
Authorization 用户令牌 abc
Content-Type 内容类型 application/json

Path Param

参数名称 介绍 举例
buildingId 建筑id abc

Query Param

参数名称 介绍 举例
page 页数 1
per_page 每页条数 10

Request Body

application/json

{
    "condition": [
        {
            "bosclass": "uoDocDocument",
            "alias": "um",
            "subCondition": [
                {
                    "field": "bosclass",
                    "operator": "==",
                    "value": "uoDocDocument",
                    "number": "false",
                    "logic": ""
                }
            ],
            "nestOr": [
                {
                    "field": "code",
                    "operator": "like",
                    "value": "c", // 搜索关键词
                    "number": "false"
                },
                {
                    "field": "name",
                    "operator": "like",
                    "value": "3", // 搜索关键词
                    "number": "false"
                }
            ]
        },
        {
            "bosclass": "uoDocFolder",
            "alias": "uf",
            "subCondition": [
                {
                    "field": "bosclass",
                    "operator": "==",
                    "value": "uoDocFolder",
                    "number": "false",
                    "logic": ""
                },
                {
                    "field": "_key",
                    "operator": "==",
                    "value": "{key}", // 文档文件夹key
                    "number": "false",
                    "logic": "And"
                }
            ]
        },
        {
            "bosclass": "irFolderDocument",
            "alias": "u1",
            "type": "relationship",
            "from": "uf",
            "to": "um",
            "subCondition": []
        }
    ],
    "select": {
        "bosclass": "um.bosclass",
        "name": "um.name",
        "key": "um._key",
        "code": "um.code",
        "creator": "um.creator",
        "createTime": "um.createTime"
    }
}

4.3. 返回内容

执行成功

{
    "message": "请求处理成功",
    "code": "SUCCESS",
    "data": {
        "data": [
            {
                "creator": "zhaobing", // 上传者
                "code": "3", // 文档编码
                "createTime": "1573108395574", // 文档数据创建时间
                "name": "3号楼", // 文档名称
                "bosclass": "uoDocDocument", // 文档bosclass
                "key": "3bdbb3aad4e2447ab951f0b9be181f81", // 文档key
            }
        ],
        "count": 1
    }
}
版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2020 all right reserved,powered by Gitbook该文件修订时间: 2021-09-23 15:25:50

results matching ""

    No results matching ""