员工管理接口


员工注册

  • 接口描述:将企业员工注册到内容中台
  • 接口地址:/api/v1/base/oauth/staff/register?token=TOKEN
  • 方法类型:POST
  • 接口入参
    参数名 是否必须 参数类型 参数说明
    name String 员工姓名
    openId String 用户唯一标识
    phone String 手机号
    roleId int 角色id,默认为3(员工)
    sex int 性别1男,2女
  • 接口返回值
    参数名 参数类型 参数说明 备注
    success Boolean true成功
    code int 200成功
    obj.staffId String 注册成功后在易企秀侧的唯一标识
    msg String 错误时的错误信息

角色变更

  • 接口描述:变更企业员工角色

  • 接口地址:/api/v1/base/corp/staff/role/change?token=TOKEN&openId=xxx&roleIds=xxx

  • 请求方式:POST

  • 接口入参

    参数名 必须 参数类型 参数说明
    openId String 企业对应的员工,已经创建的
    roleIds array[Long] 数组类型 1所有者,2管理员,3员工

    说明:1为所有者不支持变更,有且只有一人为此角色

  • 接口出参

    {
      "success": true,
      "code": "200",
      "msg": null,
      "obj": null,
      "map": null,
      "list": []
    }
    

查询员工列表

  • 接口描述:分页查询员工列表。

  • 接口地址:/api/v1/base/corp/staff/list?token=TOKEN

  • 方法类型:GET

  • 接口入参

    参数名 是否必须 参数类型 参数说明
    pageNo String 页码
    pageSize String 每页数量
    deptId Long 部门id,不传查询全部
    keyWord String 姓名关键词,模糊搜索
  • 返回值示例:

    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": null,
    "map": {
      "pageNo": 1,
      "count": 2,
      "pageSize": 20,
      "end": true
    },
    "list": [
      {
        "id": "b95804db510849dfa0cf566d25c9dbc4",
        "corpId": "10ab1f1bfd004a5881a9afb271a6516f",
        "accountId": null,
        "name": "open@test",
        "mobile": null,
        "email": null,
        "gender": 0,
        "avatar": null,
        "status": 1,
        "createTime": "2022-02-14 16:55:06",
        "depts": null,
        "roles": null,
        "deptName": "我的企业",
        "openId": null,
        "thirdId": null,
        "code": "2202146"
      },
      {
      ...
      }
    ]
    }
    
  • 返回值说明

    参数名 参数类型 参数说明 备注
    success Boolean true成功
    code int 200成功
    msg String 错误时的错误信息
    id String 员工id
    corpId String 企业id
    accountId String 账号id
    name String 员工名称
    mobile String 手机号
    email String 邮箱
    gender int 性别。0表示未定义,1表示男性,2表示女性
    avatar String 头像
    status int 1:有效 -1:删除,2:停用
    createTime Datetime 创建时间
    depts List 所属部门
    roles List 所属角色
    deptName String 部门名称
    openId String 用户唯一标识
    code String 员工编码

    ```

    员工删除

  • 接口描述:删除对应员工

  • 接口地址:/api/v1/base/corp/staff/delete?token=TOKEN&openIds=

  • 请求方式:POST

  • 接口入参

    参数名 必须 参数类型 参数说明
    openIds String 企业对应的员工唯一标识,删除多个员工,用逗号分隔
  • 接口出参

    {
      "success": true,
      "code": "200",
      "msg": null,
      "obj": null,
      "map": null,
      "list": []
    }
    

    部门变更

  • 接口描述:变更企业员工所属部门

  • 接口地址:/api/v1/base/corp/staff/dept/change?token=TOKEN&openId=xxx&departmentIds=xxx

  • 请求方式:POST

  • 接口入参

    参数名 必须 参数类型 参数说明
    openId String 企业对应的员工,已经创建的
    departmentIds array[Long] 部门id,对应部门管理接口“查询部门”返回的id
  • 接口出参

    {
      "success": true,
      "code": "200",
      "msg": null,
      "obj": null,
      "map": null,
      "list": []
    }
    

    员工停用

  • 接口描述:停用对应员工

  • 接口地址:/api/v1/base/corp/staff/disable?token=TOKEN&openIds=

  • 请求方式:POST

  • 接口入参

    参数名 必须 参数类型 参数说明
    openIds String 企业对应的员工唯一标识,停用多个员工用逗号分隔
  • 接口出参

    {
      "success": true,
      "code": "200",
      "msg": null,
      "obj": null,
      "map": null,
      "list": []
    }
    

    员工启用

  • 接口描述:启用对应员工

  • 接口地址:/api/v1/base/corp/staff/enable?token=TOKEN&openIds=

  • 请求方式:POST

  • 接口入参

    参数名 必须 参数类型 参数说明
    openIds String 企业对应的员工唯一标识,启用多个员工用逗号分隔
  • 接口出参

    {
      "success": true,
      "code": "200",
      "msg": null,
      "obj": null,
      "map": null,
      "list": []
    }
    

will 2025年1月2日 11:22 5639 收藏文档