{
  "module": {
    "module": "OpenAPI 接口",
    "moduleKey": "openapi"
  },
  "api": {
    "title": "有状态会员系统支持校验（场景B）",
    "method": "POST",
    "path": "/openapi/memberships/check",
    "description": "场景B：校验已登录用户的会员有效性，并校验该用户的会员类型是否已配置支持指定系统。适用于系统级访问控制，如黄金会员才能访问系统B。",
    "requestParams": {
      "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": "系统编码，同时作为校验目标（会员类型是否支持该系统）"
        }
      ]
    },
    "responseExamples": {
      "校验通过": {
        "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"
          }
        }
      },
      "会员类型不支持该系统": {
        "code": "1007",
        "message": "会员类型未授权当前系统",
        "data": null
      },
      "未找到有效会员记录": {
        "code": "1503",
        "message": "未找到有效的会员记录",
        "data": null
      }
    },
    "notes": [
      "需在管理后台「会员功能管理」中为该会员类型配置支持该系统，否则会返回1007",
      "系统校验基于 memberFunctions 表（memberTypeId + systemId + status=1）"
    ]
  }
}