refactor(api): 拆分 duplication.ts 为目录结构(types/duplication/index) #953

Closed
xiaoxia wants to merge 2 commits from refactor/duplication-api into develop
Owner

变更说明

将 99 行的 duplication.ts 拆分为目录化结构,保持导入路径向后兼容。

拆分结构

api/duplication/
├── types.ts        # 类型定义
├── duplication.ts  # 全部 5 个 API 函数
└── index.ts        # 统一入口 re-export

变更统计

  • 旧文件:duplication.ts 99 行 → 删除
  • 新入口:index.ts ~25 行
  • 新增文件:3 个
  • 导入路径 @/api/duplication 保持不变,向后兼容

影响范围

无业务逻辑变更,纯文件结构调整。

## 变更说明 将 99 行的 duplication.ts 拆分为目录化结构,保持导入路径向后兼容。 ## 拆分结构 ``` api/duplication/ ├── types.ts # 类型定义 ├── duplication.ts # 全部 5 个 API 函数 └── index.ts # 统一入口 re-export ``` ## 变更统计 - 旧文件:duplication.ts 99 行 → 删除 - 新入口:index.ts ~25 行 - 新增文件:3 个 - 导入路径 `@/api/duplication` 保持不变,向后兼容 ## 影响范围 无业务逻辑变更,纯文件结构调整。
xiaoxia added 1 commit 2026-07-26 17:17:34 +08:00
refactor(api): 拆分 duplication.ts 为目录结构(types/duplication/index)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 15s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 23s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m5s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m27s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m31s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m4s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 2m23s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 54s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 46s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 2m36s
AI Code Review / AI Code Review (pull_request) Successful in 2m25s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 6m15s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 20s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
c853fa2ceb
将 99 行的 duplication.ts 拆分为目录化结构:
- types.ts: 类型定义(查重记录/片段/详情/响应)
- duplication.ts: 全部 5 个 API 函数
- index.ts: 统一入口 re-export,保持 @/api/duplication 路径向后兼容
xiaoxia added 1 commit 2026-07-27 12:34:52 +08:00
Merge branch 'develop' into refactor/duplication-api
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 14s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m24s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m13s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 36s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 35s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 2m54s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 53s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m15s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m50s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 43s
AI Code Review / AI Code Review (pull_request) Successful in 2m6s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 15m21s
CI/CD Pipeline / CI Gate (pull_request) 失败: CI/CD Pipeline / Validate - Code Quality (pull_request) [frontend-only]
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 16s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
ab1faf97e9
auto-approve-bot approved these changes 2026-07-27 14:03:18 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-07-27 14:03:18 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。

🚀 预览环境已部署

项目 详情
PR号 #953
预览链接 https://pr-953.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #953 | | 预览链接 | [https://pr-953.preview.xiaoxiajianji.com](https://pr-953.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
Collaborator

代码审查结果 - PR #953

⚠️ 问题(1个需要修改)

  1. apps/web/src/api/duplication/duplication.ts 第14行:上传文件时手动设置了 Content-Type-: multipart/form-data,这会阻止浏览器或 Axios 自动添加必要的 boundary 参数。缺少 boundary 参数会导致后端无法解析请求体,从而引发文件上传失败(通常报错 400 Bad Request 或无法读取文件)。

💡 建议(0个可选)

(无)


格式检查通过 | 逻辑审查需修改 | 性能良好


🤖 由 AI 代码审查机器人自动生成 | 2026-07-27 06:04:11 | 模型:

## 代码审查结果 - PR #953 ### ⚠️ 问题(1个需要修改) 1. **apps/web/src/api/duplication/duplication.ts 第14行**:上传文件时手动设置了 `Content-Type-: multipart/form-data`,这会阻止浏览器或 Axios 自动添加必要的 `boundary` 参数。缺少 boundary 参数会导致后端无法解析请求体,从而引发文件上传失败(通常报错 400 Bad Request 或无法读取文件)。 ### 💡 建议(0个可选) (无) --- ✅ 格式检查通过 | ❌ 逻辑审查需修改 | ✅ 性能良好 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-07-27 06:04:11 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->
Collaborator

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.
xiaoxia closed this pull request 2026-07-27 16:33:16 +08:00

🗑️ 预览环境已清理

PR #953 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #953 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Some checks are pending
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 14s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m24s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m13s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 36s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 35s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 2m54s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 53s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m15s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m50s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 43s
AI Code Review / AI Code Review (pull_request) Successful in 2m6s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 15m21s
CI/CD Pipeline / CI Gate (pull_request) 失败: CI/CD Pipeline / Validate - Code Quality (pull_request) [frontend-only]
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 16s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.