4. 部门管理

新增部门

接口地址

api/department/addDepartment

请求方式

POST

请求参数
请求参数 必传 参数说明
department_name 部门名称
sort 排序
响应示例
{
    "code": 200,
    "message": "成功",
    "data": ""
}

更新部门,删除部门

当status=0的时候视为删除部门

接口地址

api/department/updateDepartment

请求方式

PUT

请求参数
请求参数 必传 参数说明
id 部门ID
department_name 部门名称
sort 排序
响应示例
{
    "code": 200,
    "message": "成功",
    "data": ""
}

获取部门详情

接口地址

api/department/getDepartmentDetail

请求方式

GET

请求参数
请求参数 必传 参数说明
id 部门ID
响应示例
{
    "code": 200,
    "message": "成功",
    "data": {
        "id": 1,
        "department_name": "开发1部", // 部门名称
        "sort": 1,
        "status": 0,
        "create_time": "2020-06-04 22:44:40",
        "update_time": "2020-06-04 23:26:53"
    }
}

获取部门列表

接口地址

api/department/getDepartmentList

请求方式

GET

请求参数
请求参数 必传 参数说明
department_name 部门名称
status 状态 0:下架 1:上架
page 页码
size 页数
响应示例
{
    "code": 200,
    "message": "成功",
    "data": {
        "total": 4,
        "per_page": "2",
        "current_page": 2,
        "last_page": 2,
        "data": [
            {
                "id": 3,
                "department_name": "运维部",
                "sort": 1,
                "status": 1,
                "create_time": "2020-06-04 22:55:55",
                "update_time": "2020-06-04 22:55:55"
            },
            {
                "id": 4,
                "department_name": "大数据部",
                "sort": 1,
                "status": 1,
                "create_time": "2020-06-04 22:56:14",
                "update_time": "2020-06-04 22:56:14"
            }
        ]
    }
}

results matching ""

    No results matching ""