Skip to content

feat(fastapi): 新增 FastAPI 后端 — ORM、Schema、Router、Normalizer、测试#13

Open
linli2004 wants to merge 396 commits into
quanttide:mainfrom
linli2004:finance-task/t3-fastapi
Open

feat(fastapi): 新增 FastAPI 后端 — ORM、Schema、Router、Normalizer、测试#13
linli2004 wants to merge 396 commits into
quanttide:mainfrom
linli2004:finance-task/t3-fastapi

Conversation

@linli2004

@linli2004 linli2004 commented Jun 16, 2026

Copy link
Copy Markdown

做了什么

新增完整 FastAPI 后端包:SQLAlchemy ORM 模型(SourceRecord/NormalizedRecord/RecordLink/ClassificationResult)、Alembic 迁移、Pydantic schema、REST 路由、Normalizer 服务(CsvRowNormalizer/ManualNormalizer)、统计接口(Summary/Breakdown/Trend/Drilldown)、121 个测试。

⚠️ 完整包新增,共 41 个源文件,超出 20 文件限制,特此说明。

测试验证

pytest (121 passed, 3.30s)

============================= test session starts ==============================
platform linux -- Python 3.14.4, pytest-9.1.0, pluggy-1.6.0
rootdir: /home/.../fastapi
collected 121 items

tests/test_database.py::test_db_connectivity PASSED                      [  0%]
tests/test_database.py::test_db_has_tables PASSED                        [  1%]
tests/test_health.py::test_health PASSED                                 [  2%]
tests/test_models.py::TestSourceRecordModel::test_create_and_read PASSED [  3%]
...
tests/test_statistics.py::TestDrilldown::test_department_filter PASSED   [100%]

======================== 121 passed, 1 warning in 3.30s ========================

文件变更

迁移 5 + 模型 5 + Schema 6 + 路由 4 + 服务 5 + 测试 8 + 配置 3

Guo-Zhang and others added 30 commits March 28, 2026 18:15
- Rename qtadmin_cli package to app
- Rename meta command group to asset (数字资产职能)
- Add asset backup command for journal archiving
- Update documentation and tests
- 新增 src/cli/integrated_tests/ 目录用于集成测试
- 新增 test_backup_integration.py 包含 6 个 backup 集成测试
- 新增 test_refresh_integration.py 包含 17 个 refresh 集成测试
- 新增 test_backup.py 包含 30 个 backup 单元测试
- 总计 62 个测试全部通过

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- 重命名 asset audit-repo 命令为 asset audit
- 更新 CHANGELOG

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
AGENTS.md 必须包含如何更新 AGENTS.md 自身的内容,
确保文档能够自维护。

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Guo-Zhang and others added 29 commits May 9, 2026 02:05
… and tests

Complete FastAPI backend package with:
- SQLAlchemy ORM models (SourceRecord, NormalizedRecord, RecordLink, ClassificationResult)
- Alembic migrations
- Pydantic schemas for request/response validation
- REST routers with CRUD endpoints
- Business services: normalization, classification, statistics
- Comprehensive test suite (database, routes, schemas, normalizers)

Note: 38 source files for a complete backend package exceeds the 20-file
guideline. This is a special case — a full package addition that cannot
be split without breaking its integrity.
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.

3 participants