# OpenAPI 接口 - 有状态会员功能模块校验（场景C）

> 模块标识：openapi  |  接口数量：66

## 接口说明
**方法**：	POST

**路径**：				/openapi/memberships/functionCheck

**功能说明**：
场景C：在场景B基础上，进一步校验该用户的会员类型在指定系统下是否开通了特定功能模块。适用于菜单/功能级别的精细控制。

### 请求参数
```json
{
  "headers": [
    {
      "name": "Authorization",
      "type": "string",
      "required": true,
      "description": "用户登录令牌，格式 Bearer TOKEN"
    },
    {
      "name": "X-Site",
      "type": "string",
      "required": true,
      "description": "站点标识"
    },
    {
      "name": "X-System-Code",
      "type": "string",
      "required": true,
      "description": "系统编码"
    },
    {
      "name": "X-Function",
      "type": "string",
      "required": true,
      "description": "功能模块代码（moduleCode），如 VIDEO_DOWNLOAD"
    }
  ]
}
```

### 响应示例

#### 校验通过

```json
{
  "code": "0000",
  "message": "校验通过",
  "data": {
    "valid": true,
    "remainingDays": 20,
    "memberType": {
      "id": "xxx",
      "name": "钻石会员",
      "code": "D001"
    },
    "memberUser": {
      "id": "mu001",
      "code": "MU000001",
      "effectiveDate": "2026-03-01",
      "validityDays": 30
    },
    "user": {
      "id": "u001",
      "code": "CU000001",
      "phone": "138****8888",
      "name": "张三"
    },
    "system": {
      "code": "system-b",
      "name": "系统B"
    },
    "function": {
      "code": "VIDEO_DOWNLOAD",
      "name": "视频下载"
    }
  }
}
```

#### 会员不支持该功能

```json
{
  "code": "1508",
  "message": "当前会员不支持当前功能",
  "data": null
}
```

#### 会员类型不支持该系统

```json
{
  "code": "1007",
  "message": "会员类型未授权当前系统",
  "data": null
}
```

### 注意事项
- 需在管理后台「会员功能模块」中为该会员类型的系统功能配置对应模块
- X-Function 传入 moduleCode（Custom类型）或 securityModule.code（Resource类型）

