量表题目分类管理

题目分类列表: /questionCategorys GET

请求参数

参数名 示列值 类型 必须 说明
page 1 number 当前页数
pageSize 10 number 每页条数
name xxx string 名称
sort -createdAt string 排序。多个排序字段用,号隔开。sort=-a,b
expand 'source' string 获取指定子资源数据 'source,questionCount'
attributes "id,name" string 本资源的字段。不定义该字段时返回所有字段;空数组不返回字段

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
参数名 示列值 类型 说明
id 1 number id
sourceId 1 number 来源组织id,0=云医后台
name 分类1 string 名称
parentId 0 number 父类id
status 0 number 状态 0=禁用 1=启用
source {"id": 1, "name": "test" } object 来源组织信息
questionCount 0 number 题目数量
createdAt 1650160322 number 创建时间
updatedAt 1650160322 number 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 1,
        "name": "分类1",
        "parentId": 0,
        "status": 1,
        "sourceId": 1,
        "source": {
          "id": 1,
          "name": "demo",
        },
        "questionCount": 0,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

新建题目分类: /questionCategorys POST

请求参数

参数名 示列值 类型 必须 说明
name 123456 string 名称

返回结果: 题目分类信息

编辑题目分类: /questionCategorys/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 123456 string 名称

返回结果: 题目分类信息

题目分类详情: /questionCategorys/:id GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 组织 id
expand 'source' string 获取指定子资源数据 'source,questionCount'
attributes ["id", "name"] array 本资源的字段。不定义该字段时返回所有字段

返回结果: 题目分类信息

删除题目分类: /questionCategorys/:id DELETE

请求参数

参数名 示列值 类型 必须 说明
id 1 number 资源id

返回示列

HTTP/1.1 204 NO CONTENT

所有题目: /listAll/questionCategorys GET

请求参数

参数名 示列值 类型 必须 说明 默认值
name xxx string 名称
expand 'source' string 获取指定子资源数据 'source'
attributes "id,name" string 本资源的字段。不定义该字段时返回所有字段;空数组不返回字段

返回结果: 题目分类信息

返回示列

HTTP/1.1 200 OK
[
  {}
]