字典项列表接口
GET
/api/v1/dictionaries/:category/:code/items
获取指定字典的所有字典项列表。
接口说明
该接口用于获取指定字典的所有字典项列表。通过指定字典类别和字典代码可以获取特定字典的所有字典项。
路径参数
参数名 | 类型 | 说明 |
---|---|---|
category | string | 字典类别,取值为 "cn"(中国标准)或 "intl"(国际标准) |
code | string | 字典代码,用于唯一标识一个字典 |
响应参数
参数名 | 类型 | 说明 |
---|---|---|
code | string | 字典项代码 |
name | string | 字典项名称 |
description | string | 字典项描述 |
parentCode | string | 父项代码 |
sort | number | 排序号 |
status | number | 状态(1-启用,0-禁用) |
响应示例
[
{
"code": "1",
"name": "男",
"description": "男性",
"sort": 1,
"status": 1
},
{
"code": "2",
"name": "女",
"description": "女性",
"sort": 2,
"status": 1
}
]
错误码
错误码 | 说明 |
---|---|
400 | 请求参数错误 |
404 | 字典不存在 |
500 | 服务器内部错误 |