AuditLogs:
  get:
    operationId: listAuditLogs
    summary: 分页查询审计日志
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - {name: keyword, in: query, schema: {type: string}}
      - {name: createdFrom, in: query, schema: {type: string, format: date-time}}
      - {name: createdTo, in: query, schema: {type: string, format: date-time}}
      - name: userId
        in: query
        schema: {$ref: '../components/schemas.yaml#/StringId'}
      - name: organizationId
        in: query
        schema: {$ref: '../components/schemas.yaml#/StringId'}
      - name: actionType
        in: query
        schema: {$ref: '../components/schemas.yaml#/AuditAction'}
      - name: operationResult
        in: query
        schema: {$ref: '../components/schemas.yaml#/AuditResult'}
      - name: targetType
        in: query
        schema: {$ref: '../components/schemas.yaml#/AuditTarget'}
      - name: targetId
        in: query
        schema: {$ref: '../components/schemas.yaml#/StringId'}
      - {name: page, in: query, schema: {type: integer, minimum: 1, default: 1}}
      - name: pageSize
        in: query
        schema: {type: integer, minimum: 1, maximum: 100, default: 20}
      - name: sortDirection
        in: query
        schema: {type: string, enum: [asc, desc], default: desc}
    responses:
      '200':
        description: 审计日志分页结果
        content:
          application/json:
            schema: {$ref: '../components/schemas.yaml#/AuditLogPageResponse'}
      '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
      '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
      '403': {$ref: '../components/responses.yaml#/Forbidden'}
      '500': {$ref: '../components/responses.yaml#/InternalError'}

DocumentStatistics:
  get:
    operationId: getDocumentStatistics
    summary: 查询文档统计概览
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
    responses:
      '200':
        description: 文档统计概览
        content:
          application/json:
            schema: {$ref: '../components/schemas.yaml#/DocumentStatisticsResponse'}
      '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
      '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
      '403': {$ref: '../components/responses.yaml#/Forbidden'}
      '500': {$ref: '../components/responses.yaml#/InternalError'}

AuditTrendStatistics:
  get:
    operationId: getAuditTrendStatistics
    summary: 查询审计趋势
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - {name: createdFrom, in: query, schema: {type: string, format: date-time}}
      - {name: createdTo, in: query, schema: {type: string, format: date-time}}
      - name: granularity
        in: query
        required: true
        schema: {$ref: '../components/schemas.yaml#/AuditGranularity'}
    responses:
      '200':
        description: 审计趋势
        content:
          application/json:
            schema: {$ref: '../components/schemas.yaml#/AuditTrendResponse'}
      '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
      '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
      '403': {$ref: '../components/responses.yaml#/Forbidden'}
      '500': {$ref: '../components/responses.yaml#/InternalError'}

AuditActionStatistics:
  get:
    operationId: getAuditActionStatistics
    summary: 查询审计动作分布
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - {name: createdFrom, in: query, schema: {type: string, format: date-time}}
      - {name: createdTo, in: query, schema: {type: string, format: date-time}}
    responses:
      '200':
        description: 审计动作分布
        content:
          application/json:
            schema: {$ref: '../components/schemas.yaml#/AuditActionStatisticsResponse'}
      '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
      '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
      '403': {$ref: '../components/responses.yaml#/Forbidden'}
      '500': {$ref: '../components/responses.yaml#/InternalError'}

AuditUserStatistics:
  get:
    operationId: getAuditUserStatistics
    summary: 查询审计活跃用户
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - {name: createdFrom, in: query, schema: {type: string, format: date-time}}
      - {name: createdTo, in: query, schema: {type: string, format: date-time}}
      - name: limit
        in: query
        schema: {type: integer, minimum: 1, maximum: 100, default: 10}
    responses:
      '200':
        description: 审计活跃用户
        content:
          application/json:
            schema: {$ref: '../components/schemas.yaml#/AuditUserStatisticsResponse'}
      '400': {$ref: '../components/responses.yaml#/InvalidArgument'}
      '401': {$ref: '../components/responses.yaml#/AuthenticationError'}
      '403': {$ref: '../components/responses.yaml#/Forbidden'}
      '500': {$ref: '../components/responses.yaml#/InternalError'}
