# OpenAPI 接口 - 无状态会员限额校验（场景D）

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

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

**路径**：				/openapi/stateless-members/limitCheck

**功能说明**：
场景D：在场景C（功能模块校验）的基础上，进一步校验当前功能模块的使用量是否已达到配置的上限（limitValue）。适用于有次数或存储上限控制的业务场景。

### 请求参数
```json
{
  "headers": [
    {
      "name": "X-Member-Key",
      "type": "string",
      "required": true,
      "description": "会员密钥令牌（混合JWT加密）"
    },
    {
      "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"
    }
  ],
  "body": {
    "currentCount": "number｜必填，当前已使用次数/数量（由第三方系统维护），如 8"
  }
}
```

### 响应示例

#### 校验通过（有限额）

```json
{
  "code": "0000",
  "message": "校验通过",
  "data": {
    "valid": true,
    "remainingDays": 25,
    "memberType": {
      "id": "xxx",
      "name": "黄金会员",
      "code": "H001"
    },
    "member": {
      "id": "yyy",
      "code": "SM000001",
      "name": "新人可享",
      "effectiveDate": "2026-03-01",
      "validityDays": 30
    },
    "system": {
      "code": "system-b",
      "name": "系统B"
    },
    "function": {
      "code": "VIDEO_DOWNLOAD",
      "name": "视频下载"
    },
    "limit": {
      "value": 10,
      "current": 8,
      "remaining": 2
    }
  }
}
```

#### 校验通过（无限额）

```json
{
  "code": "0000",
  "message": "校验通过",
  "data": {
    "valid": true,
    "remainingDays": 25,
    "limit": null
  }
}
```

#### 已达使用上限

```json
{
  "code": "1010",
  "message": "当前功能使用已达上限（10）",
  "data": {
    "limitValue": 10,
    "currentCount": 10
  }
}
```

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

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

#### 会员类型未授权系统

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

### 注意事项
- limit 字段为 null 表示该功能未配置限额，即不限次数
- limit.remaining = limit.value - currentCount，小于等于0时拒绝
- currentCount 由第三方系统自行维护并传入，本系统不做存储
- 限额配置在管理后台 会员功能限制（memberFunctionLimits）中设置

