refactor backend packages and global db service

This commit is contained in:
2026-07-18 21:58:15 +08:00
parent 62bd3d0455
commit 7800b07d42
51 changed files with 719 additions and 647 deletions

View File

@@ -20,6 +20,9 @@
- 使用 Go、Gin、Gorm 和 PostgreSQL。
- 后端模块集中放在 `backend/internal` 下,并保持职责聚焦。
- 使用模块路径 `senlinai-agent/backend`
- 业务逻辑包统一放在 `backend/internal/logic` 下,例如 `ai``auth``files``inbox``notes``projects``search``tasks`
- Gorm 模型和数据库连接入口统一放在 `backend/internal/models`,不要恢复独立的 `domain``db` 包。
- 模型结构体使用 `SenlinAgent` 前缀,数据库表名使用 `senlin_agent_` 前缀。
- 所有服务端本地文件路径构造必须集中在文件服务中。
- 不允许 HTTP handler 直接构造存储路径。
- 项目标签必须限定在项目内MVP 阶段不要引入全局标签体系。