字典详情接口

GET /api/v1/dictionaries/:category/:code

获取指定字典的详细信息,包括所有字典项。

接口说明

该接口用于获取指定字典的完整信息,包括字典的基本信息和所有字典项。通过指定字典类别和字典代码可以获取特定字典的详细信息。

路径参数

参数名 类型 说明
category string 字典类别,取值为 "cn"(中国标准)或 "intl"(国际标准)
code string 字典代码,用于唯一标识一个字典

响应参数

参数名 类型 说明
code string 字典代码
name string 字典名称
version string 字典版本
description string 字典描述
source string 数据来源
items array 字典项列表

响应示例

{
    "code": "GB_T2261.1",
    "name": "性别代码",
    "version": "1.0",
    "description": "中华人民共和国国家标准 GB/T 2261.1-2003 性别代码",
    "source": "国家标准化管理委员会",
    "items": [
        {
            "code": "1",
            "name": "男",
            "description": "男性",
            "sort": 1
        },
        {
            "code": "2",
            "name": "女",
            "description": "女性",
            "sort": 2
        }
    ]
}

错误码

错误码 说明
400 请求参数错误
404 字典不存在
500 服务器内部错误