更新时间:2024-08-19 GMT+08:00
分享

List

功能介绍

List接口用于获取自身实例/实体的属性信息。

入参

POST http://{Endpoint}/rdm_{appID}_app/services/dynamic/api/{entityName}/list/pageSize/curPage
{
    "params": {
        "sorts": [
            {
                "sort": "DESC",
                "orderBy": "属性名称"
            }

        ],
        "filter": {
            ......
        },
        "isNeedTotal": true
    }
}
  • {Endpoint}表示数据建模引擎所在域名或IP地址,{appID}表示应用ID,{entityName}表示实体的英文名称。
  • 在URL上填写待查询的页码(curPage)和每页可显示的数据量(pageSize)。
  • 在JSON代码中的设置sorts字段和filter字段。
    • sorts:填写需要按哪个字段进行排序,可为空。
    • filter:填写过滤条件,可为空。

出参

仅返回本模型的属性信息。如果属性的类型为参数对象,只返回ID和clazz。

示例场景

有一个实例(People),先按名称倒序排序,再按年龄倒序排序。而后根据性别为男性进行过滤。

入参示例

POST http://dme.cn-north-4.huaweicloud.com/rdm_01a2b2c4764d4e00f123g345fd9baa9f_app/services/dynamic/api/People/list/20/1
{
    "params": {
        "sorts": [
            {
                "sort": "DESC",
                "orderBy": "name"
            },
            {
                "sort": "DESC",
                "orderBy": "age"
            }
        ],
        "filter": {
            "joiner": "and",
            "conditions": [
                {
                    "conditionName": "gender",
                    "operator": "=",
                    "conditionValues": [
                        "男"
                    ]
                }
            ]
        },
        "isNeedTotal": true
    }
}

出参示例

{
    "result": "SUCCESS",
    "data": [
        {
            "id": "455304645330341888",
            "creator": "test1 3c03e719256a427eb9277b64fcXXXXXX",
            "createTime": "2023-01-13T01:38:07.000+00:00",
            "modifier": "test1 3c03e719256a427eb9277b64fcXXXXXX",
            "lastUpdateTime": "2023-01-13T01:38:07.000+00:00",
            "rdmVersion": 1,
            "rdmExtensionType": "People",
            "rdmDeleteFlag": 0,
            "tenant": {           //tenant为参考对象
                "id": "-1",
                "clazz": "Tenant"
            },
            "className": "People",
            "name": "李四",
            "description": null,
            "kiaguid": null,
            "securityLevel": "internal",
            "gender": "男",
            "age": 20
        },
        {
            "id": "455304534248394752",
            "creator": "test1 3c03e719256a427eb9277b64fcXXXXXX",
            "createTime": "2023-01-13T01:37:40.000+00:00",
            "modifier": "test1 3c03e719256a427eb9277b64fcXXXXXX",
            "lastUpdateTime": "2023-01-13T01:37:40.000+00:00",
            "rdmVersion": 1,
            "rdmExtensionType": "People",
            "rdmDeleteFlag": 0,
            "tenant": {           //tenant为参考对象
                "id": "-1",
                "clazz": "Tenant"
            },
            "className": "People",
            "name": "张三",
            "description": null,
            "kiaguid": null,
            "securityLevel": "internal",
            "gender": "男",
            "age": 18
        }
    ],
    "errors": [],
    "pageInfo": {
        "curPage": 1,
        "pageSize": 20,
        "totalRows": 2,
        "totalPages": 1
    }
}

相关文档