refactor(api): 拆分 bgm/projects/tags 为目录结构(API层全面目录化收尾) #954

Closed
xiaoxia wants to merge 2 commits from refactor/bgm-projects-tags-api into develop
Owner

变更说明

批量拆分三个小 API 文件,完成前端 API 层全面目录化。所有模块保持导入路径向后兼容。

拆分结构

bgm(68 行)

api/bgm/
├── types.ts      # 类型定义
├── constants.ts  # DEFAULT_BGM_MIX_CONFIG
├── bgm.ts        # getBgmPresets
└── index.ts      # 统一入口

projects(60 行)

api/projects/
├── types.ts   # 类型定义
├── utils.ts   # toProjectItem
├── projects.ts # 3 个 API 函数
└── index.ts   # 统一入口

tags(40 行)

api/tags/
├── types.ts  # TagItem
├── tags.ts   # 5 个 API 函数
└── index.ts  # 统一入口

变更统计

  • 删除单文件:3 个(bgm.ts/projects.ts/tags.ts)
  • 新增目录:3 个,共 11 个文件
  • 导入路径 @/api/bgm / @/api/projects / @/api/tags 保持不变

影响范围

无业务逻辑变更,纯文件结构调整。API 层 13 个模块全部目录化完成。

## 变更说明 批量拆分三个小 API 文件,完成前端 API 层全面目录化。所有模块保持导入路径向后兼容。 ## 拆分结构 ### bgm(68 行) ``` api/bgm/ ├── types.ts # 类型定义 ├── constants.ts # DEFAULT_BGM_MIX_CONFIG ├── bgm.ts # getBgmPresets └── index.ts # 统一入口 ``` ### projects(60 行) ``` api/projects/ ├── types.ts # 类型定义 ├── utils.ts # toProjectItem ├── projects.ts # 3 个 API 函数 └── index.ts # 统一入口 ``` ### tags(40 行) ``` api/tags/ ├── types.ts # TagItem ├── tags.ts # 5 个 API 函数 └── index.ts # 统一入口 ``` ## 变更统计 - 删除单文件:3 个(bgm.ts/projects.ts/tags.ts) - 新增目录:3 个,共 11 个文件 - 导入路径 `@/api/bgm` / `@/api/projects` / `@/api/tags` 保持不变 ## 影响范围 无业务逻辑变更,纯文件结构调整。API 层 13 个模块全部目录化完成。
xiaoxia added 1 commit 2026-07-26 17:20:09 +08:00
refactor(api): 拆分 bgm/projects/tags 为目录结构(API 层全面目录化收尾)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 22s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 35s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m13s
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 32s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m11s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 2m40s
AI Code Review / AI Code Review (pull_request) Successful in 1m20s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m13s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m20s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 47s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 2m39s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 6m56s
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 / Frontend Unit Tests (pull_request) Failing after 30s
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
7a5a9bcacf
批量拆分三个小 API 文件:
- bgm.ts (68行) → types/constants/bgm/index
- projects.ts (60行) → types/utils/projects/index
- tags.ts (40行) → types/tags/index

全部保持 @/api/xxx 导入路径向后兼容。

至此前端 API 层所有单文件模块全部目录化,共 13 个 API 模块统一结构。
xiaoxia added 1 commit 2026-07-27 12:34:50 +08:00
Merge branch 'develop' into refactor/bgm-projects-tags-api
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 22s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m5s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m4s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 1m30s
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 26s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 36s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m56s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 41s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 42s
AI Code Review / AI Code Review (pull_request) Successful in 1m21s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 3m52s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 15m16s
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 / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 18s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Has been cancelled
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 / Deploy Production (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 13s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
36cb6123e7
auto-approve-bot approved these changes 2026-07-27 14:00:10 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

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

CI全绿,自动审批通过。

CI全绿,自动审批通过。

🚀 预览环境已部署

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

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

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

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

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

代码审查结果 - PR #954

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

💡 建议(0个可选)


格式检查通过 | 逻辑审查通过 | 性能无隐患


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

## 代码审查结果 - PR #954 ### ⚠️ 问题(0个需要修改) ### 💡 建议(0个可选) --- ✅ 格式检查通过 | ✅ 逻辑审查通过 | ✅ 性能无隐患 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-07-27 06:00:36 | 模型: </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:17 +08:00

🗑️ 预览环境已清理

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

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

🗑️ **预览环境已清理** PR #954 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Some checks are pending
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 22s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m5s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m4s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 1m30s
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 26s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 36s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m56s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 41s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 42s
AI Code Review / AI Code Review (pull_request) Successful in 1m21s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 3m52s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 15m16s
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 / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 18s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Has been cancelled
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 / Deploy Production (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 13s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.