Skip to content

Conversation

@coltea
Copy link
Contributor

@coltea coltea commented Oct 24, 2025

PR 标题

文档树解析

相关 Issue

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:

  1. 文档树解析

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors document tree parsing by consolidating multiple platform-specific crawling endpoints into a unified interface. The changes introduce a generalized parsing and export flow that handles various document sources (Feishu, Notion, Confluence, etc.) through common endpoints instead of dedicated routes per platform.

Key Changes:

  • Consolidated 20+ platform-specific endpoints into 2 unified endpoints (/parse and /export)
  • Introduced tree-structured document response format (Child type with recursive structure)
  • Standardized return types across all document source APIs to use common ListDocResponse

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
backend/usecase/crawler_feishu.go Deleted - Feishu-specific usecase methods removed
backend/usecase/crawler.go Major refactor - consolidated parsing logic into ParseUrl() and ExportDoc() methods
backend/pkg/anydoc/*.go Updated return types to use shared ListDocResponse structure
backend/pkg/anydoc/res.go Added new tree-structured response types (Child, Value, ListDocResponse)
backend/handler/v1/crawler.go Removed 18+ platform-specific handlers, replaced with 2 unified handlers
backend/docs/swagger.yaml Updated API documentation reflecting consolidated endpoints
backend/consts/parse.go New file defining CrawlerSource enum and type classification
backend/api/crawler/v1/crawler.go Updated request/response structures for unified API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xiaomakuaiz xiaomakuaiz merged commit bbef07f into chaitin:main Oct 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants