/**
 * 统一分页参数解析，全局限制 pageSize ≤ 200，防止过量数据查询
 */
export function parsePagination(query: Record<string, any>): { page: number; pageSize: number } {
  const page = Math.max(1, parseInt(query.page as string) || 1)
  const pageSize = Math.min(Math.max(1, parseInt(query.pageSize as string) || 20), 200)
  return { page, pageSize }
}
