# 职员管理

> 模块标识：staff  |  接口数量：5

## 1. 获取职员列表
**方法**：	GET

**路径**：				/api/staff

**功能说明**：
获取职员列表，支持按部门筛选

### 请求参数
```json
{
  "query": [
    {
      "name": "pageNum",
      "type": "number",
      "required": false,
      "description": "页码，默认1"
    },
    {
      "name": "pageSize",
      "type": "number",
      "required": false,
      "description": "每页数量，默认10"
    },
    {
      "name": "organizationId",
      "type": "string",
      "required": false,
      "description": "所属组织筛选"
    },
    {
      "name": "name",
      "type": "string",
      "required": false,
      "description": "姓名关键词"
    }
  ]
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "获取成功",
    "data": {
      "list": [
        {
          "id": 1,
          "code": "STA0001",
          "name": "张三",
          "phone": "13800000001",
          "organizationId": "ORG0001",
          "status": 1,
          "createTime": "2025-01-01T10:00:00.000Z"
        }
      ],
      "total": 100,
      "pageNum": 1,
      "pageSize": 10
    }
  }
}
```


## 2. 获取职员详情
**方法**：	GET

**路径**：				/api/staff/{id}

**功能说明**：
根据职员ID获取职员详细信息

### 请求参数
```json
{
  "path": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "职员ID"
    }
  ]
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "获取成功",
    "data": {
      "id": 1,
      "code": "STA0001",
      "name": "张三",
      "phone": "13800000001",
      "organizationId": "ORG0001",
      "status": 1,
      "createTime": "2025-01-01T10:00:00.000Z"
    }
  },
  "failure": {
    "code": "4040",
    "message": "职员不存在",
    "data": null
  }
}
```


## 3. 创建职员
**方法**：	POST

**路径**：				/api/staff

**功能说明**：
创建新的职员

### 请求参数
```json
{
  "body": {
    "name": "string｜必填，职员姓名",
    "phone": "string｜必填，手机号",
    "organizationId": "string｜必填，所属组织ID",
    "status": "number｜可选，状态：1-在职，0-离职"
  }
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "创建职员成功",
    "data": {
      "id": 1,
      "code": "STA0001",
      "name": "张三",
      "phone": "13800000001",
      "organizationId": "ORG0001",
      "status": 1,
      "createTime": "2025-01-01T10:00:00.000Z"
    }
  },
  "failure": {
    "code": "4000",
    "message": "创建职员失败",
    "data": null
  }
}
```


## 4. 更新职员
**方法**：	PUT

**路径**：				/api/staff/{id}

**功能说明**：
更新指定职员的信息

### 请求参数
```json
{
  "body": {
    "name": "string｜必填，职员姓名",
    "phone": "string｜必填，手机号",
    "organizationId": "string｜必填，所属组织ID",
    "status": "number｜可选，状态：1-在职，0-离职"
  },
  "path": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "职员ID"
    }
  ]
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "更新职员成功",
    "data": {
      "id": 1,
      "code": "STA0001",
      "name": "张三",
      "phone": "13800000001",
      "organizationId": "ORG0001",
      "status": 1,
      "createTime": "2025-01-01T10:00:00.000Z"
    }
  },
  "failure": {
    "code": "4000",
    "message": "更新职员失败",
    "data": null
  }
}
```


## 5. 删除职员
**方法**：	DELETE

**路径**：				/api/staff/{id}

**功能说明**：
删除指定的职员

### 请求参数
```json
{
  "path": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "职员ID"
    }
  ]
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "删除职员成功",
    "data": {
      "result": true
    }
  },
  "failure": {
    "code": "4000",
    "message": "删除职员失败",
    "data": null
  }
}
```

