{
  "module": {
    "module": "资源管理",
    "moduleKey": "resource"
  },
  "api": {
    "title": "查询所有有效资源",
    "method": "GET",
    "path": "/api/resources/active",
    "description": "查询所有有效的资源配置列表，用于其他业务通过选择列表选择目标资源。返回所有 status = 1 的资源，不需要分页。优先通过 x-system-code（系统编码）和 x-function（模块编码）进行过滤，同时兼容 systemId/moduleId 查询参数。支持通过 X-Site header 切换站点，切换后查询对应站点的数据库。",
    "requestParams": {
      "headers": [
        {
          "name": "x-system-code",
          "type": "string",
          "required": false,
          "description": "系统编码（如 AUTH_MANAGEMENT）。传入后优先用于定位系统"
        },
        {
          "name": "x-function",
          "type": "string",
          "required": false,
          "description": "模块编码或模块ID。传入后用于按模块过滤资源，建议与 x-system-code 搭配"
        }
      ],
      "query": [
        {
          "name": "systemId",
          "type": "string",
          "required": false,
          "description": "所属系统ID（兼容参数）。未传 x-system-code 时可用，不传则返回所有系统的有效资源"
        },
        {
          "name": "moduleId",
          "type": "string",
          "required": false,
          "description": "关联模块ID（兼容参数）。未传 x-function 时可用，用于按模块过滤资源"
        }
      ]
    },
    "responseExample": {
      "success": {
        "code": "0000",
        "message": "获取成功",
        "data": [
          {
            "id": 1,
            "code": "RES0001",
            "name": "用户列表",
            "title": "用户列表",
            "systemId": "系统ID",
            "systemName": "权限管理系统",
            "type": "page",
            "url": "/users",
            "status": 1,
            "parentId": null,
            "moduleId": "AUTH_USER",
            "orderNum": 1,
            "createTime": "2025-01-01T10:00:00.000Z"
          },
          {
            "id": 2,
            "code": "RES0002",
            "name": "角色管理",
            "title": "角色管理",
            "systemId": "系统ID",
            "systemName": "权限管理系统",
            "type": "page",
            "url": "/roles",
            "status": 1,
            "parentId": null,
            "moduleId": "AUTH_ROLE",
            "orderNum": 2,
            "createTime": "2025-01-01T11:00:00.000Z"
          }
        ]
      }
    },
    "notes": [
      "仅返回 status = 1 的有效资源",
      "按 orderNum 和 createTime 排序",
      "不需要分页，返回完整列表",
      "优先支持通过 x-system-code（系统编码）过滤指定系统资源",
      "优先支持通过 x-function（模块编码/模块ID）过滤指定模块资源（需同时指定系统）",
      "兼容通过 systemId/moduleId 查询参数过滤",
      "也支持通过路径参数 systemId 查询（如 /api/security/systems/{systemId}/resources/active）"
    ]
  }
}