云医端 API V2.0

登陆: /login POST

请求参数

参数名 示列值 类型 必须 说明
account 13333333333 string 登陆账号
password 123456 string 登陆密码 base64 加密
kind 1 nuber 1=账号+密码;2=企业微信登录(account=code;password=corpId,agentId)

返回参数

参数名 示列值 说明
token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 token
name super_admin 名称
account 13333333333 账号
roleId 1 角色 id
remark fsfsafs 备注
avatar http://oss-shenzhen/abc.png 头像
status 1 状态
isSuper 0 是否超管

返回示列

HTTP/1.1 200 OK
{
    "id": 1,
    "name": "super_admin",
    "account": "13333333333",
    "isSuper": 0,
    "roleId": 0,
    "remark": "",
    "avatar": "",
    "creatorId": 0,
    "status": 1,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoic3VwZXJfYWRtaW4iLCJpZCI6MSwiaWF0IjoxNjUwMjc5MzQ5LCJleHAiOjE2NTAyODY1NDl9.pRAwxvhiST1ERVPG2g_pTAKCrtcVoajATiPHlRkPsdc"
}
登出: /logout POST
HTTP/1.1 204 NO CONTENT
修改密码: /accounts/:id/modifyPassword PUT

请求参数

参数名 示列值 类型 必须 说明
id 1 number 账号 id
oldPassword 123456 string 旧密码
newPassword 321123 string 新密码
confirmPassword 321123 string 确认密码

返回参数

参数名 示列值 说明
name 超级管理员 名称
account 13333333333 账号
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像

返回示列

HTTP/1.1 200 OK
{
  "name": "超级管理员",
  "account": "13333333333",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
}
获取 oss 上传凭证: /alioss/sts POST

请求参数

参数名 示列值 类型 必须 说明
actionType IMPORT_ACCOUNT_EXCEL string 类型['IMPORT_ACCOUNT_EXCEL', 'ACCOUNT_IMAGE','MEDIA', 'REPORT_PDF']

返回参数

参数名 示列值 说明
accessKeyId STS.NURfFs9g3XSb1bEh9MSb12Fh1 accessKeyId
accessKeySecret 25h2epzxKxMYVZArK8uK7CYKyRcA8rSaFUaMeTeJPq8y accessKeySecret
securityToken CAIS8QF1q6Ft5B2yfSjIr5bnLfzH1LgS+KLrf0ceusbFbpjzJ6xaCAGxypQ12iN+/i6/clF securityToken
expiration 2022-04-18T09:39:04Z expiration
region oss-cn-shenzhen region
bucket bs-develop-share bucket
directory import_account_excel 上传目录

返回示列

HTTP/1.1 200 OK
{
    "accessKeyId": "STS.NURfFs9g3XSb1bEh9MSb12Fh1",
    "accessKeySecret": "25h2epzxKxMYVZArK8uK7CYKyRcA8rSaFUaMeTeJPq8y",
    "securityToken": "CAIS8QF1q6Ft5B2yfSjIr5bnLfzH1LgS75GJM0T0jDkYX+0d3YPD0zz2IHBNfHZoB+8ZtPQzlW5Q6/YZlqAqDpRCQ1fDacYoYBKXeej5MeT7oMWQweEuqv/MQBq+aXPS2MvVfJ+KLrf0ceusbFbpjzJ6xaCAGxypQ12iN+/i6/clFKN1ODO1dj1bHtxbCxJ/ocsBTxvrOO2qLwThjxi7biMqmHIl1Dknsf3lmZDAukOD1Qaq8IJP+dSteKrDRtJ3IZJyX+2y2OFLbafb2EZSkUMarf8p1PIbpm2X4oDDWwQBuA/nNPHPt8J1LRN0dmLbqWW7CkmWGoABdbdE/gV5Y0tCsjxBU/PozEuMZvnKVuUA4C//UFPgTK8rqBPGUvq5zZEp5jlUG3SB0bq5HsINFQlH7qWm6Rdv/nJ3xZeKVNdYU9u7TgLBKm+nnWClUrp3oIrV1A1fjy0niUPrP6kaxCuFCaRSF9p/Oh7PYJRAVpo+wKWzTZP8/zs=",
    "expiration": "2022-04-18T09:39:04Z",
    "region": "oss-cn-shenzhen",
    "bucket": "bs-develop-share",
    "directory": "import_account_excel"
}
获取 oss 上传凭证: /oss/sts POST

请求参数

参数名 示列值 类型 必须 说明
actionType IMPORT_ACCOUNT_EXCEL string 类型['IMPORT_ACCOUNT_EXCEL', 'ACCOUNT_IMAGE','MEDIA', 'REPORT_PDF']

返回参数

参数名 示列值 说明
accessKeyId STS.NURfFs9g3XSb1bEh9MSb12Fh1 accessKeyId
accessKeySecret 25h2epzxKxMYVZArK8uK7CYKyRcA8rSaFUaMeTeJPq8y accessKeySecret
securityToken CAIS8QF1q6Ft5B2yfSjIr5bnLfzH1LgS+KLrf0ceusbFbpjzJ6xaCAGxypQ12iN+/i6/clF securityToken
expiration 2022-04-18T09:39:04Z expiration
region oss-cn-shenzhen region
bucket bs-develop-share bucket
directory import_account_excel 上传目录
endpoint http://127.0.0.1:9000 OSS 对外服务的访问域名 ossType 为 2 时返回
ossType 1 1-阿里 OSS 2-MinIO

返回示列

HTTP/1.1 200 OK
{
    "accessKeyId": "STS.NURfFs9g3XSb1bEh9MSb12Fh1",
    "accessKeySecret": "25h2epzxKxMYVZArK8uK7CYKyRcA8rSaFUaMeTeJPq8y",
    "securityToken": "CAIS8QF1q6Ft5B2yfSjIr5bnLfzH1LgS75GJM0T0jDkYX+0d3YPD0zz2IHBNfHZoB+8ZtPQzlW5Q6/YZlqAqDpRCQ1fDacYoYBKXeej5MeT7oMWQweEuqv/MQBq+aXPS2MvVfJ+KLrf0ceusbFbpjzJ6xaCAGxypQ12iN+/i6/clFKN1ODO1dj1bHtxbCxJ/ocsBTxvrOO2qLwThjxi7biMqmHIl1Dknsf3lmZDAukOD1Qaq8IJP+dSteKrDRtJ3IZJyX+2y2OFLbafb2EZSkUMarf8p1PIbpm2X4oDDWwQBuA/nNPHPt8J1LRN0dmLbqWW7CkmWGoABdbdE/gV5Y0tCsjxBU/PozEuMZvnKVuUA4C//UFPgTK8rqBPGUvq5zZEp5jlUG3SB0bq5HsINFQlH7qWm6Rdv/nJ3xZeKVNdYU9u7TgLBKm+nnWClUrp3oIrV1A1fjy0niUPrP6kaxCuFCaRSF9p/Oh7PYJRAVpo+wKWzTZP8/zs=",
    "expiration": "2022-04-18T09:39:04Z",
    "region": "oss-cn-shenzhen",
    "bucket": "bs-develop-share",
    "directory": "import_account_excel",
    "endpoint": "http://127.0.0.1:9000",
    "ossType": 1
}

新建权限: /acls POST (机构端 /organizationAcls)

请求参数

参数名 示列值 类型 必须 说明
name 系统管理 string 名称
description 描述咯 string 权限描述
parentId 1 number 上级 id
level 12 number 层级
type 1 number 类型 1=菜单 2=按钮 3=功能
path /cnosole/system string 菜单路径
action 1 string 动作 1=create 2=edit, tpye=2 时必填
icon bars string 图标
apiPath /cnosole/systems string api 请求路径
method POST string 请求方法
sort 22 number 排序
aclIds [1,2,3] array 依赖权限
isShow 1 number 是否显示 0=否 1=是

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "系统管理",
  "description": "描述咯",
  "parentId": 1,
  "level": 2,
  "type": 1,
  "path": "/cnosole/system",
  "action": 1,
  "icon": "bars",
  "sort": 3,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

删除权限: /acls/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑权限: /acls/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 系统管理 string 名称
description 描述咯 string 权限描述
parentId 1 number 上级 id
level 12 number 层级
type 1 number 类型 1=菜单 2=按钮 3=功能
path /cnosole/system string 菜单路径 type=1 时必填
action 1 string 动作 1=create 2=edit, tpye=2 时必填
icon bars string 图标
sort 22 number 排序

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "系统管理",
  "description": "描述咯",
  "parentId": 1,
  "level": 2,
  "type": 1,
  "path": "/cnosole/system",
  "action": 1,
  "icon": "bars",
  "sort": 3,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

权限详情: /acls/:id GET

请求参数

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

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "系统管理",
  "description": "描述咯",
  "parentId": 1,
  "level": 2,
  "type": 1,
  "path": "/cnosole/system",
  "action": 1,
  "icon": "bars",
  "sort": 3,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

权限列表: /acls GET

请求参数

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

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 1,
        "name": "系统管理",
        "description": "描述咯",
        "parentId": 1,
        "level": 2,
        "type": 1,
        "path": "/cnosole/system",
        "action": 1,
        "icon": "bars",
        "sort": 3,
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

所有权限菜单: /listAll/acls GET

请求参数

参数名 示列值 类型 必须 说明 默认值
type 1 number 权限类型 1=菜单 2=按钮 3=功能

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
[
  {
    "id": 1,
    "name": "系统管理",
    "description": "描述咯",
    "parentId": 1,
    "level": 2,
    "type": 1,
    "path": "/cnosole/system",
    "action": 1,
    "icon": "bars",
    "sort": 3,
    "status": 1,
    "createdAt": 1647846587,
    "updatedAt": 1647846587,
  }
]

权限树形列表: /treeList/acls GET

请求参数

参数名 示列值 类型 必须 说明 默认值
type 1 number 权限类型 1=菜单 2=按钮 3=功能

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
children [{"id": 1, "name": "xx"}] 子权限
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
[{
  "id": 1,
  "name": "系统管理",
  "description": "描述咯",
  "parentId": 1,
  "level": 2,
  "type": 1,
  "path": "/cnosole/system",
  "action": 1,
  "icon": "bars",
  "sort": 3,
  "children": [{
    "id": 1,
    "name": "账号管理",
    "description": "描述咯",
    "parentId": 1,
    "children": [],
    "level": 2,
    "type": 1,
    "path": "/cnosole/system",
    "action": 1,
    "icon": "bars",
    "sort": 3,
  }],
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}],

账号权限树形列表: /account/acls GET

返回参数

参数名 示列值 说明
id 1 id
name 系统管理 名称
description 描述咯 权限描述
parentId 1 上级 id
level 12 层级
type 1 类型
path /cnosole/system 菜单路径
children [{"id": 1, "name": "xx"}] 子权限
action 1 动作
icon bars 图标
sort 1 类型
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
[{
  "id": 1,
  "name": "系统管理",
  "description": "描述咯",
  "parentId": 1,
  "level": 2,
  "type": 1,
  "path": "/cnosole/system",
  "action": 1,
  "icon": "bars",
  "sort": 3,
  "children": [{
    "id": 1,
    "name": "账号管理",
    "description": "描述咯",
    "parentId": 1,
    "children": [],
    "level": 2,
    "type": 1,
    "path": "/cnosole/system",
    "action": 1,
    "icon": "bars",
    "sort": 3,
  }],
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}],

新建组织模版: /organizationAclTemplates POST

请求参数

参数名 示列值 类型 必须 说明
name 123456 string 模版名称
description 321123 string 模版描述
aclIds [1,2,3,4] array 权限 id 数组

返回参数

参数名 示列值 说明
id 1 id
name cbti 系统菜单 名称
description 我是描述 描述

返回示列

HTTP/1.1 201 OK
{
  "name": "cbti 系统菜单",
  "description": "我是描述",
}

删除组织模版: /organizationAclTemplates/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑组织模版: /organizationAclTemplates/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 123456 string 模版名称
description 321123 string 模版描述
aclIds [1,2,3,4] array 权限 id 数组

返回参数

参数名 示列值 说明
id 1 id
name cbti 系统菜单 名称
description 我是描述 描述
aclIds [1,2,3,4,5] 权限 id 数组

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "cbti 系统菜单",
  "description": "我是描述",
}

组织模版详情: /organizationAclTemplates/:id GET

请求参数

| 参数名 | 示列值 | 类型 | 必须 | 说明 | | ---------- | -------------- | ------ | ---- | ------------------------------------------------------- | --- | | id | 1 | number | 是 | 组织 id | | aclType | 1 | number | 否 | 权限类型, 过滤菜单或按钮或功能权限 | | expand | creator | string | 否 | 获取指定子资源数据 ['creator', 'organizations', 'acls'] | | | attributes | ["id", "name"] | array | 否 | 本资源的字段。不定义该字段时返回所有字段 | |

返回参数

参数名 示列值 说明
id 4 id
name 模版名称 描述
description 描述说明啦啦啦 描述
acls [{ "id": 2, "name": "权限名称"}] 权限数组对象
creator { "id": 2, "name": "账号名"} 创建者对象
organizations [{ "id": 2, "name": "模版名"}] 机构应用数组对象
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间
  • acls
参数名 示列值 说明
id 2 id
icon edit 菜单 icon
level 1 层级
type 1 类型 1=菜单 2=按钮 3=功能
action 1 动作类型 1=create 2=edit, 当 type=1 时为 null
sort 2 序号
path /console/organizationTemplates/edit 菜单路径 type=2 时为 null
name 模版管理 名称
description 模版管理 123 描述
parentId 1 上级 id
children [{ "id": 4, "name": "test2"}] 子权限数组对象

返回示列

HTTP/1.1 200 OK
{
  "id": 4,
  "name": "cbti 系统菜单",
  "account": "我是描述",
  "systemName": "失眠认知行为疗法管理系统",
  "systemLogo": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "acls": [{
    "id": 1231,
    "children": [],
    "icon": "edit",
    "level": 1,
    "type": 1,
    "action": null,
    "sort": 1,
    "path": "/console/organizationTemplates/edit",
    "name": "模版管理",
    "description": "模版管理",
    "parentId": null,
  }],
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

组织模版列表: /organizationAclTemplates GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
name cbti string 名称搜索
sort -createdAt number 排序。多个排序字段用,号隔开。sort=-a,b
search hello string 搜索关键字
aclType 1 number 权限类型, 过滤菜单或按钮或功能权限
expand creator string 获取指定子资源数据 ['creator', 'organizations', 'acls']
attributes ["id", "name"] array 本资源的字段。不定义该字段时返回所有字段

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 说明
id 4 id
name 模版名称 模版名称
description 描述说明啦啦啦 描述
acls [{ "id": 2, "name": "test2"}] 权限数组对象
organizations [{ "name": "机构名称"}] 模版应用情况
creator { "id": 2, "name": "账号名"} 创建者对象
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间
  • acls
参数名 示列值 说明
id 2 id
icon edit 菜单 icon
level 1 层级
type 1 类型 1=菜单 2=按钮 3=功能
action 1 动作类型 1=create 2=edit, 当 type=1 时为 null
sort 2 序号
path /console/organizationTemplates/edit 菜单路径 type=2 时为 null
name 模版管理 名称
description 模版管理 123 描述
parentId 1 上级 id
children [{ "id": 4, "name": "test2"}] 子权限数组对象

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 4,
        "name": "模版名称1",
        "description": "模版描述1",
        "organizations": [{"name": "机构名称"}],
        "acls": [{
          "id": 1231,
          "children": [],
          "icon": "edit",
          "level": 1,
          "type": 1,
          "action": null,
          "sort": 1,
          "path": "/console/organizationTemplates/edit",
          "name": "模版管理",
          "description": "模版管理",
          "parentId": null,
        }],
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
      },
      {
        "id": 3,
        "name": "模版名称2",
        "description": "模版描述2",
        "organizations": [{"name": "机构名称"}],
        "acls": [{
          "id": 1231,
          "children": [],
          "icon": "edit",
          "level": 1,
          "type": 1,
          "action": 1,
          "sort": 2,
          "path": "/console/organizationTemplates/edit",
          "name": "模版管理",
          "description": "模版管理",
          "parentId": null,
        }],
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
      },
    ],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

所有组织模版: /listAll/organizationAclTemplates GET

请求参数

参数名 示列值 类型 必须 说明 默认值
expand creator string 获取指定子资源数据 ['creator', 'organizations', 'acls']
aclType 1 number 权限类型, 过滤菜单或按钮或功能权限

返回参数

参数名 示列值 说明
id 4 id
name 模版 111 名称
description 描述说明啦啦啦 描述
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
[
  {
    "id": 4,
    "name": "模版名称1",
    "description": "模版描述1",
    "status": 1,
    "createdAt": 1647846587,
    "updatedAt": 1647846587,
  },
]

模版是否存在: isExist/organizationAclTemplates GET

请求参数

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

返回参数

参数名 示列值 说明
isExist true 是否存在

返回示列

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

进入组织: /organizations/:id/sso POST

请求参数

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

返回参数

参数名 示列值 说明
domain http://127.0.0.1 域名
code 674c2c196619918697074b6d4394eb2b code

返回示列

HTTP/1.1 200 OK
{
  "domain": "http://127.0.0.1",
  "code": "674c2c196619918697074b6d4394eb2b"
}

新建组织: /organizations POST

请求参数

参数名 示列值 类型 必须 说明
name blabala string 组织名称
code 13945685459 string 账号
password 123456 string 密码
province 广东省 string
city 深圳市 string
region 南山区 string
miniAppType 1 number 小程序类型:(1:睡眠管理小程序,2:自在森林小程序,3:CBTD)
address 广东省深圳市南山区高新南四道 string 详细地址
systemName 失眠认知行为疗法管理系统 string 系统名称
systemLogo https://test.oss.aliyuncs.com/avatar/28c02.jpg string 系统 logo
aclIds [1,2,3,4] array 权限 id 数组
agentId 11 number 代理商 id
aclTemplateId 11 number 组织模版 id

返回参数

参数名 示列值 说明
id 1 id
name cbti 系统 组织名称
code 13322233323 账号
systemName 失眠认知行为疗法管理系统 系统名称
systemLogo https://test.oss.aliyuncs.com/avatar/28c02.jpg 系统

返回示列

HTTP/1.1 201 OK
{
  "name": "cbti 系统菜单",
  "code": "13322233323",
  "systemName": "失眠认知行为疗法管理系统",
  "systemLogo": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
}

删除组织: /organizations/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑组织: /organizations/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name blabala string 组织名称
code 13945685459 string 账号
province 广东省 string
city 深圳市 string
region 南山区 string
address 广东省深圳市南山区高新南四道 string 详细地址
systemName 失眠认知行为疗法管理系统 string 系统名称
systemLogo https://test.oss.aliyuncs.com/avatar/28c02.jpg string 系统 logo
aclIds [1,2,3,4] array 权限 id 数组
agentId 11 number 代理商 id

返回参数

参数名 示列值 说明
id 1 id
name cbti 系统 组织名称
code 13322233323 账号
systemName 失眠认知行为疗法管理系统 系统名称
systemLogo https://test.oss.aliyuncs.com/avatar/28c02.jpg 系统 logo

返回示列

HTTP/1.1 200 OK
{
  "name": "cbti 系统菜单",
  "code": "13322233323",
  "systemName": "失眠认知行为疗法管理系统",
  "systemLogo": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
}

组织详情: /organizations/:id GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 组织 id
aclType 1 number 权限类型, 过滤菜单或按钮或功能权限

返回参数

参数名 示列值 说明
id 1 id
name blabala 组织名称
code 13945685459 账号
province 广东省
city 深圳市
region 南山区
address 广东省深圳市南山区高新南四道 详细地址
systemName 失眠认知行为疗法管理系统 系统名称
systemNogo https://test.oss.aliyuncs.com/avatar/28c02.jpg 系统 logo
acls [{ "id": 2, "name": "test2"}] 权限数组对象
agentId 11 代理商 id
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间
  • acls
参数名 示列值 说明
id 2 id
icon edit 菜单 icon
level 1 层级
type 1 类型 1=菜单 2=按钮 3=功能
action 1 动作类型 1=create 2=edit, 当 type=1 时为 null
sort 2 序号
path /console/organizationTemplates/edit 菜单路径 type=2 时为 null
name 模版管理 名称
description 模版管理 123 描述
parentId 1 上级 id
children [{ "id": 4, "name": "test2"}] 子权限数组对象

返回示列

HTTP/1.1 200 OK
{
  "id": 4,
  "name": "cbti 系统菜单",
  "code": "13322233323",
  "systemName": "失眠认知行为疗法管理系统",
  "systemLogo": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "acls": [{
    "id": 1231,
    "children": [],
    "icon": "edit",
    "level": 1,
    "type": 1,
    "action": null,
    "sort": 1,
    "path": "/console/organizationTemplates/edit",
    "name": "模版管理",
    "description": "模版管理",
    "parentId": null,
  }],
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

组织列表: /organizations GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
name 阿里药房 string 名称搜索
code 1333333333 string 账号搜索
region 南山区 string 区域搜索
sort -createdAt number 排序。多个排序字段用,号隔开。sort=-a,b
search hello string 搜索关键字
expand agent string 获取指定子资源数据 ['agent','creator', 'acls']
attributes ["id", "name"] array 本资源的字段。不定义该字段时返回所有字段;空数组不返回字段

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 类型 说明
id 1 number id
name blabala string 组织名称
code 13945685459 string 账号
province 广东省 string
city 深圳市 string
region 南山区 string
address 广东省深圳市南山区高新南四道 string 详细地址
userCount 99 number 累计患者
systemName 失眠认知行为疗法管理系统 string 系统名称
systemLogo https://test.oss.aliyuncs.com/avatar/28c02.jpg string 系统 logo
agentId 11 number 代理商 id
creator { "id": 1, "name": "账号名称"} 创建者对象
agent { "id": 1, "name": "代理商名称"} 代理商对象
acls [{ "id": 2, "name": "test2"}] 权限数组对象
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 4,
        "name": "组织名称",
        "code": "13945685459",
        "province": "广东省",
        "city": "深圳市",
        "region": "南山区",
        "address": "广东省深圳市南山区高新南四道",
        "systemName": "失眠认知行为疗法管理系统",
        "systemLogo": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
        "agentId": 1,
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

新建代理商: /agents POST

请求参数

参数名 示列值 类型 必须 说明
name 你好代理商 11 string 代理商名称

返回参数

参数名 示列值 说明
id 1 id
name 你好代理商 11 代理商名称
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "你好代理商123",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

删除代理商: /agents/:id DELETE

请求参数

参数名 示列值 类型 必须 说明
id 1 number 代理商 id

返回示列

HTTP/1.1 204 NO CONTENT

编辑代理商: /agents/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 你好代理商 11 string 代理商名称

返回参数

参数名 示列值 说明
id 1 id
name 你好代理商 11 代理商名称
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "你好代理商123",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

代理商详情: /agents/:id GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 代理商 id

返回参数

参数名 示列值 说明
id 1 id
name 你好代理商 11 代理商名称
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "你好代理商123",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

代理商列表: /agents GET

请求参数

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

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 说明
id 1 id
name blabala 代理商名称
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 4,
        "name": "代理商名称",
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

所有代理商: /listAll/agents GET

返回参数

参数名 示列值 说明
id 1 id
name blabala 代理商名称
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
[
  {
    "id": 4,
    "name": "角色名称",
    "status": 1,
    "createdAt": 1647846587,
    "updatedAt": 1647846587,
  }
]

新建角色: /roles POST

请求参数

参数名 示列值 类型 必须 说明
name 超级管理员 string 角色名称
description 我是描述啦 string 描述
aclIds [1,2,3,4,5] array 权限 id 数组
scoprType 1 number 数据范围 0=全部 1=本部门及下属 2=本部门 3=本人
organizationIds [1,2,3,4] array 机构 id 数组

返回参数

参数名 示列值 说明
id 1 id
name 超级管理员 角色名称
description 我是描述啦 描述
scoprType 1 数据范围
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "超级管理员",
  "description": "我是描述啦",
  "scoprType": 0,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

删除角色: /roles/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑角色: /roles/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 超级管理员 string 角色名称
description 我是描述啦 string 描述
aclIds [1,2,3,4,5] array 权限 id 数组
scoprType 1 number 数据范围 0=全部 1=本部门及下属 2=本部门 3=本人
organizationIds [1,2,3,4] array 机构 id 数组

返回参数

参数名 示列值 说明
id 1 id
name 超级管理员 角色名称
description 我是描述啦 描述
scoprType 1 数据范围
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "超级管理员",
  "description": "我是描述啦",
  "scoprType": 0,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

角色详情: /roles/:id GET

请求参数

| 参数名 | 示列值 | 类型 | 必须 | 说明 | | ------ | ------ | ------ | ---- | --------------------------- | --- | | id | 1 | number | 是 | 角色 id | | expand | acls | string | 否 | 获取指定子资源数据 ['acls'] | |

返回参数

参数名 示列值 说明
id 1 id
name 超级管理员 角色名称
description 我是描述啦 描述
scoprType 1 数据范围
acls [{"id": 1, "name": "xx"}] 权限数组对象
organizationIds [1,2,3,4,5] 机构 id 数组
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间
  • acls
参数名 示列值 说明
id 2 id
icon edit 菜单 icon
level 1 层级
type 1 类型 1=菜单 2=按钮 3=功能
action 1 动作类型 1=create 2=edit, 当 type=1 时为 null
sort 2 序号
path /console/organizationTemplates/edit 菜单路径 type=2 时为 null
name 模版管理 名称
description 模版管理 123 描述
parentId 1 上级 id
children [{ "id": 4, "name": "test2"}] 子权限数组对象

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "超级管理员",
  "description": "我是描述啦",
  "scoprType": 0,
  "acls": [{
    "id": 1231,
    "children": [],
    "icon": "edit",
    "level": 1,
    "type": 1,
    "action": 1,
    "sort": 2,
    "path": "/console/organizationTemplates/edit",
    "name": "模版管理",
    "description": "模版管理",
    "parentId": null,
  }],
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

角色列表: /roles GET

请求参数

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

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 说明
id 1 id
name 超级管理员 角色名称
description 我是描述啦 描述
userCount 112 人员数量
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 4,
        "name": "角色名称",
        "description": "我是描述啦",
        "userCount": 12,
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

所有角色: /listAll/roles GET

返回参数

参数名 示列值 说明
id 1 id
name 超级管理员 角色名称
description 我是描述啦 描述
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
[
  {
    "id": 4,
    "name": "角色名称",
    "description": "我是描述啦",
    "userCount": 12,
    "status": 1,
    "createdAt": 1647846587,
    "updatedAt": 1647846587,
  }
]

角色是否存在: isExist/roles GET

请求参数

参数名 示列值 类型 必须 说明
id 1 number 角色 id
name 角色名称 string 角色名称
type 角色类型 number 角色类型:0=其他角色,1=默认角色,2=管理员)

返回参数

参数名 示列值 说明
isExist true 是否存在

返回示列

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

新建部门: /departments POST

请求参数

参数名 示列值 类型 必须 说明
name 总斤半 string 部门名称
parentId 11 number 上级部门 id

返回参数

参数名 示列值 说明
id 1 id
name 总斤半 部门名称
parentId 11 上级部门 id
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "总斤半lalala",
  "parentId": 11,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

删除部门: /departments/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑部门: /departments/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name 总斤半 string 部门名称
parentId 11 number 上级部门 id

返回参数

参数名 示列值 说明
id 1 id
name 总斤半 部门名称
parentId 11 上级部门 id
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "总斤半",
  "parentId": 11,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

部门详情: /departments/:id GET

请求参数

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

返回参数

参数名 示列值 说明
id 1 id
name 总斤半 部门名称
parentId 11 上级部门 id
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "总斤半",
  "parentId": 11,
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

部门列表: /departments GET

请求参数

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

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"] 返回数据项
  • items
参数名 示列值 说明
id 1 id
name 总经办 部门名称
parentId 1 上级部门 id
userCount 12 本部门人员数量(不包含下级)
childUserCount 12 包含下级部门人员数量
children [{"id": 1, "name": "子部门"}] 子部门数组对象
status 1 状态 0=禁用 1=启用
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 4,
        "name": "部门名称",
        "parentId": null,
        "userCount": 12,
        "childUserCount": 132,
        "children": [{
          "id": 31,
          "name": "部门名称",
          "parentId": 4,
          "userCount": 12,
          "childUserCount": 132,
          "children": [],
          "status": 1,
          "createdAt": 1647846587,
          "updatedAt": 1647846587,
        }],
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

部门树形列表: /treeList/departments GET

返回参数

参数名 示列值 说明
id 1 id
name 总经办 部门名称
parentId 1 上级部门 id
children [{"id": 1, "name": "子部门"}] 子部门数组对象
createdAt 1647846587 创建时间
updatedAt 1647846587 更新时间

返回示列

HTTP/1.1 200 OK
[{
  "id": 4,
  "name": "部门名称",
  "parentId": null,
  "children": [{
    "id": 31,
    "name": "部门名称",
    "parentId": 4,
    "children": [],
    "status": 1,
  }],
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}],

新建账号: /accounts POST

请求参数

参数名 示列值 类型 必须 说明
name super string 名称
account 13232123212 string 登陆账号
password 123456 string 密码
roleId 11 number 角色 id
departmentIds [1,2,3] array 部门 id 数组
remark 备注备注备注 string 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg string 头像
status 1 number 启用状态 0 禁用 1 启用

返回参数

参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "super",
  "account": "13232123212",
  "remark": "备注备注备注",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

删除账号: /accounts/:id DELETE

请求参数

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

返回示列

HTTP/1.1 204 NO CONTENT

编辑账号: /accounts/:id PUT

请求参数

参数名 示列值 类型 必须 说明
name super string 名称
account 13232123212 string 登陆账号
password 123456 string 密码
roleId 11 number 角色 id
departmentIds [1,2,3] array 部门 id
remark 备注备注备注 string 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg string 头像
status 1 number 启用状态 0 禁用 1 启用

返回参数

参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "super",
  "account": "13232123212",
  "remark": "备注备注备注",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

账号详情: /accounts/:id GET

请求参数

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

返回参数

参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
roleId 1 角色 id
departmentIds [1,2,3] 部门 ids
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "super",
  "account": "13232123212",
  "roleId": 1,
  "departmentIds": [1,2,3],
  "remark": "备注备注备注",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

列表所有账号: /listAll/accounts GET

请求参数

参数名 示列值 类型 必须 说明 默认值
departmentIds [1] number[] 部门
name 超级管理员 string 名称搜索
account 133333333 string 账号搜索

账号列表: /accounts GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
name 超级管理员 string 名称搜索
account 133333333 string 账号搜索
roleId 1 number 角色搜索
departmentIds [1,2,3] array 部门搜索
status 1 number 状态搜索
sort -createdAt number 排序。多个排序字段用,号隔开。sort=-a,b
search hello string 搜索关键字
expand department string 获取指定子资源数据 ['departments', 'role', 'creator']
attributes ["id", "name"] array 本资源的字段。不定义该字段时返回所有字段;空数组不返回字段

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "name": "test2"}] 返回数据项
  • items
参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
roleId 1 角色 id
role { "id": 4, "name": "test2"} 关联角色对象
departmentIds [1,2,3] 部门 ids
departments [{ "id": 4, "name": "test2"}] 关联部门数组对象
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 1,
        "name": "super",
        "account": "13232123212",
        "roleId": 1,
        "role": {
          "id": 1,
          "name": "超级管理员"
        },
        "departmentIds": [1,2,3],
        "departments": [{
          "id": 1,
          "name": "总经办"
        }],
        "remark": "备注备注备注",
        "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
        "status": 1,
        "createdAt": 1647846587,
        "updatedAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

修改账号状态: /accounts/:id/status PUT

请求参数

参数名 示列值 类型 必须 说明
id 1 number 账号 id
status 1 number 状态 1=启用 0=禁用

返回参数

参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
roleId 1 角色 id
departmentIds [1,2,3] 部门 ids
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "super",
  "account": "13232123212",
  "roleId": 1,
  "departmentIds": [1,2,3],
  "remark": "备注备注备注",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

重置密码: /accounts/:id/resetPassword PUT

请求参数

参数名 示列值 类型 必须 说明
id 1 number 账号 id
password 1 string 新密码

返回参数

参数名 示列值 说明
id 1 id
name super 名称
account 13232123212 登陆账号
remark 备注备注备注 备注
roleId 1 角色 id
departmentIds [1,2,3] 部门 ids
remark 备注备注备注 备注
avatar https://test.oss.aliyuncs.com/avatar/28c02.jpg 头像
status 1 0 禁用 1 启用
createdAt 1650160322 创建时间
updatedAt 1650160322 更新时间

返回示列

HTTP/1.1 200 OK
{
  "id": 1,
  "name": "super",
  "account": "13232123212",
  "roleId": 1,
  "departmentIds": [1,2,3],
  "remark": "备注备注备注",
  "avatar": "https://test.oss.aliyuncs.com/avatar/28c02.jpg",
  "status": 1,
  "createdAt": 1647846587,
  "updatedAt": 1647846587,
}

账号导入: /importExcel/accounts POST

请求参数

参数名 示列值 类型 必须 说明
fileUrl https://bs-develop-share.oss-cn-shenzhen.aliyuncs.com/%EF%6%9D%BF.xls string 文件地址

返回参数

参数名 示列值 说明
data [{id: 1, name: "123"}] 导入成功数据
errData [{index: "序号", message: "说明"}] 错误数据

返回示列

HTTP/1.1 200 OK
{
    "data": [],
    "errData": [
      {
        "index": 2,
        "message": "暂无当前部门"
      },
      {
        "index": 3,
        "message": "暂无当前部门"
      },
      {
        "index": 4,
        "message": "暂无当前部门"
      }
    ]
  }

日志列表: /logs GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
menu_code 10010201 string 菜单搜索 菜单编码
operator_id 1 string 账号搜索 账号 id
createdAt [112313132,14432234] string 时间搜索
sort -createdAt number 排序。多个排序字段用,号隔开。sort=-a,b
search hello string 搜索关键字
expand department string 获取指定子资源数据 ['departments', 'role', 'creator']
attributes ["id", "name"] array 本资源的字段。不定义该字段时返回所有字段;空数组不返回字段

返回参数

参数名 示列值 说明
page 1 当前页数
pageSize 10 每页条数
limit 10 同 pageSize
offset 2 起始条数
total 3231 符合条件的总数量
items [{ "id": 4, "account": "test2"}] 返回数据项
  • items
参数名 示列值 说明
id 1 id
menu_name 部门 菜单
operator_name 13232123212 账号
detail 新建部门:销售中心 操作详情
createdAt 1650160322 创建时间

返回示列

HTTP/1.1 200 OK
{
    "items": [
      {
        "id": 1,
        "menu": "部门",
        "account": "13232123212",
        "detail": "新建部门:销售中心  ",
        "createdAt": 1647846587,
    }],
    "total": 4070,
    "offset": 1,
    "limit": 2,
    "page": 1,
    "pageSize": 2
  }

所有地区列表: /listAll/regions GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
level 等级 string 等级 [ 'Province','City','Area','Street','Village']
provinceCode 12 string 省份编码
cityCode 2 string 城市编码
areaCode 3 number 地区编码
streetCode 4 string 街道编码

返回参数

参数名 示列值 说明
id 1 id
name 深圳 名称
code 123 编码
provinceCode 12 省份编码
cityCode 2 城市编码
areaCode 3 地区编码
streetCode 4 街道编码

返回示列

HTTP/1.1 200 OK
[{
  "id": 1,
  "name": "部门",
  "code": "111",
  "provinceCode": "4",
  "cityCode": "3",
  "areaCode": "2",
  "streetCode": "1",
}]

树形地区列表: /treeList/regions GET

请求参数

参数名 示列值 类型 必须 说明 默认值
page 1 number 当前页数 1
pageSize 10 number 每页条数 10
level 等级 string 等级 [ 'Province','City','Area','Street','Village']
provinceCode 12 string 省份编码
cityCode 2 string 城市编码
areaCode 3 number 地区编码
streetCode 4 string 街道编码

返回参数

参数名 示列值 说明
id 1 id
name 深圳 名称
code 123 编码
provinceCode 12 省份编码
cityCode 2 城市编码
areaCode 3 地区编码
streetCode 4 街道编码
children 4 子地区

返回示列

HTTP/1.1 200 OK
[{
  "id": 1,
  "name": "部门",
  "code": "111",
  "provinceCode": "4",
  "cityCode": "3",
  "areaCode": "2",
  "streetCode": "1",
  "children": [{
    "id": 2,
    "name": "部门",
    "code": "111",
    "provinceCode": "4",
    "cityCode": "3",
    "areaCode": "2",
    "streetCode": "1",
    "children":
  }]
}]

根据企微部门列表员工 /listByWechatDept/accounts GET

请求参数

参数名 示列值 类型 必须 说明 默认值
name 刘诗诗 string 按名称搜索

返回参数

| 参数名 | 示列值 | 说明 | | ---------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------- | ------------------------------------- | | id | 1 | id | | name | 深圳 | 名称 | | workWechatDeptId | 1 | 企业微信部门 id | | parentId | 0 | 上级部门 id | | deptType | 1 | 1 表示是部门数据 | | account | ZhaoYuHan | string | 账号; deptType=0 才有该字段 | | avatar | http://wework.qpic.cn/bizmail/5PhROTavlkqdhlQicuic063NZ956RZjeKWe996dvNnZs43x8hsNEficQA/0 | string | 头像; deptType=0 才有该字段 | | workWechatQrcode | | string | 企业微信二维码; deptType=0 才有该字段 | | children | [] | 部门数组或员工数组; deptType=0 才有该字段 |

返回示列

HTTP/1.1 200 OK
[
  {
      "id": 511,
      "name": "速眠",
      "workWechatDeptId": 1,
      "parentId": 0,
      "deptType": 1,
      "children": [
        {
          "id": 245,
          "deptType": 0,
          "name": "赵雨涵",
          "account": "ZhaoYuHan",
          "avatar": "http://wework.qpic.cn/bizmail/5PhROTavlkqdhlQicuic063NZ956RZjeKWe996dvNnZs43x8hsNEficQA/0",
          "workWechatUserId": "ZhaoYuHan",
          "workWechatQrcode": "https://open.work.weixin.qq.com/wwopen/userQRCode?vcode=vc995df969c497b487"
        },
        {
          "id": 543,
          "name": "创新业务部",
          "workWechatDeptId": 34,
          "parentId": 513,
          "deptType": 1,
          "children": [
            {
              "id": 313,
              "name": "赵宏霖",
              "account": "13537804840",
              "avatar": "https://wework.qpic.cn/bizmail/T46bMWciaPOQOH00ib1Dkzl8zLn1gMG5UWru6jODCp6ibNesUO2zGPpVw/0",
              "workWechatUserId": "dumbbell",
              "workWechatQrcode": "https://open.work.weixin.qq.com/wwopen/userQRCode?vcode=vc1af07fa7c227ae6c"
            }
          ]
        },
      ]
    }
]