训练方案分类管理

训练方案分类列表: /trainProgramCategorys GET

请求参数

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

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{},{}] 返回数据项(具体字段看分类信息)
参数名 示列值 说明
id 1 id
organizationId 1 机构id(0:超管创建)
name 康复训练 分类名称
trainProgramCount 8 扩展字段:该分类下训练方案数量
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
    {
      "id": 1,
      "name": "康复训练",
      "trainProgramCount": 8,
      "createdAt": 1650160322,
      "updatedAt": 1650160322,
    },
  ],
  "page": 1,
  "pageSize": 10,
  "limit": 10,
  "offset": 2,
  "total": 15
}

所有分类: /listAll/trainProgramCategorys GET

请求参数

参数名 示列值 类型 必须 说明
expand string 否 获取指定子资源数据
attributes ["id", "name"] array 否 本资源的字段。不定义该字段时返回所有字段
name 康复训练 string 否 分类名称

返回示列

HTTP/1.1 200 OK
[
  { "id": 1, "name": "康复训练", "trainProgramCount": 8 }
]

分类详情: /trainProgramCategorys/:id GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 是 id
attributes ["id", "name"] array 否 本资源的字段。不定义该字段时返回所有字段

返回结果: 分类信息

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "康复训练",
  "trainProgramCount": 8,
  "createdAt": 1650160322,
  "updatedAt": 1650160322,
}

新建分类: /trainProgramCategorys POST

请求参数

参数名 示列值 类型 必须 说明
name 康复训练 string 是 分类名称

返回结果: 分类信息

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "康复训练",
  "createdAt": 1650160322,
  "updatedAt": 1650160322,
}

编辑分类: /trainProgramCategorys/:id PUT

请求参数

参数名 示列值 类型 必须 说明
id 1 number 是 id
name 康复训练 string 是 分类名称

返回结果: 分类信息

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "康复训练",
  "createdAt": 1650160322,
  "updatedAt": 1650160322,
}

删除分类: /trainProgramCategorys/:id DELETE

请求参数

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

返回示列

HTTP/1.1 200

名称是否重复: /isExist/trainProgramCategorys GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 否 分类id
name 康复训练 string 是 名称

返回示列

HTTP/1.1 200 OK
{
  "isExist": true,
}