# 会员功能管理

> 模块标识：memberFunction  |  接口数量：6

## 1. 获取会员功能列表
**方法**：	GET

**路径**：				/api/members/functions

**功能说明**：
分页获取会员功能配置列表，支持按会员类型、系统、状态筛选

### 请求参数
```json
{
  "query": [
    {
      "name": "pageNum",
      "type": "number",
      "required": false,
      "description": "页码，默认1"
    },
    {
      "name": "pageSize",
      "type": "number",
      "required": false,
      "description": "每页数量，默认10"
    },
    {
      "name": "memberTypeId",
      "type": "string",
      "required": false,
      "description": "按会员类型ID筛选"
    },
    {
      "name": "systemId",
      "type": "string",
      "required": false,
      "description": "按系统ID筛选"
    },
    {
      "name": "status",
      "type": "number",
      "required": false,
      "description": "状态：1-启用，0-禁用"
    }
  ]
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "获取成功",
    "data": {
      "list": [
        {
          "id": 1,
          "code": "MF0001",
          "memberTypeId": "xxx",
          "memberType": "VIP会员",
          "systemId": "yyy",
          "systemName": "权限管理系统",
          "status": 1,
          "description": "会员功能配置示例"
        }
      ],
      "total": 1,
      "pageNum": 1,
      "pageSize": 10
    }
  }
}
```


## 2. 获取会员功能详情
**方法**：	GET

**路径**：				/api/members/functions/{id}

**功能说明**：
根据ID获取会员功能配置详情

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

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "获取成功",
    "data": {
      "id": 1,
      "code": "MF0001",
      "memberTypeId": "xxx",
      "memberType": "VIP会员",
      "systemId": "yyy",
      "systemName": "权限管理系统",
      "status": 1
    }
  },
  "failure": {
    "code": "4040",
    "message": "会员功能不存在",
    "data": null
  }
}
```


## 3. 创建会员功能
**方法**：	POST

**路径**：				/api/members/functions

**功能说明**：
为会员类型配置系统级功能入口（同会员类型+系统唯一）

### 请求参数
```json
{
  "body": {
    "memberTypeId": "string｜必填，会员类型ID",
    "systemId": "string｜必填，系统ID",
    "status": "number｜可选，状态：1-启用，0-禁用，默认1",
    "description": "string｜可选，描述"
  }
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "创建成功",
    "data": {
      "id": 1,
      "code": "MF0001",
      "memberTypeId": "xxx",
      "memberType": "VIP会员",
      "systemId": "yyy",
      "systemName": "权限管理系统",
      "status": 1
    }
  },
  "failure": {
    "code": "4090",
    "message": "该会员类型在当前系统下已配置功能",
    "data": null
  }
}
```


## 4. 更新会员功能
**方法**：	PUT

**路径**：				/api/members/functions/{id}

**功能说明**：
更新会员功能配置（可更新会员类型、系统、状态、描述）

### 请求参数
```json
{
  "path": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "会员功能ID"
    }
  ],
  "body": {
    "memberTypeId": "string｜可选，会员类型ID",
    "systemId": "string｜可选，系统ID",
    "status": "number｜可选，状态：1-启用，0-禁用",
    "description": "string｜可选，描述"
  }
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "更新成功",
    "data": {
      "id": 1,
      "code": "MF0001",
      "memberTypeId": "xxx",
      "systemId": "yyy",
      "status": 1
    }
  }
}
```


## 5. 删除会员功能
**方法**：	DELETE

**路径**：				/api/members/functions/{id}

**功能说明**：
删除会员功能配置，同时会清理其关联的功能模块关系

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

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "删除成功",
    "data": {
      "result": true
    }
  }
}
```


## 6. 切换会员功能状态
**方法**：	PUT

**路径**：				/api/members/functions/{id}/status

**功能说明**：
切换会员功能配置启用/禁用状态

### 请求参数
```json
{
  "path": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "会员功能ID"
    }
  ],
  "body": {
    "status": "number｜必填，状态：1-启用，0-禁用"
  }
}
```

### 响应示例
```json
{
  "success": {
    "code": "0000",
    "message": "状态更新成功",
    "data": {
      "id": 1,
      "code": "MF0001",
      "status": 1
    }
  }
}
```

