feat(backend): establish gin sqlite service skeleton

This commit is contained in:
QiuSW
2026-07-25 22:29:56 +08:00
parent 84f2da3cf7
commit ab21219a07
32 changed files with 1854 additions and 42 deletions
+12
View File
@@ -60,6 +60,18 @@ internal/platform/ # 配置、日志、文件存储和 VLM 适配器
- 在 Gin handler 中写任务状态机、SQL 或仓储业务逻辑。
- 保存拼多多密码、支付凭证或支付验证码。
T-201 已建立的基础包只有 `config`、`platform/database`、`platform/migration` 和
`transport/httpapi`。HTTP 进程使用非零 read-header/read/write/idle timeout、
1 MiB header 上限和 10 秒有界关闭;默认监听 `127.0.0.1:8080`,扩大监听范围必须
显式配置。Gin 不启用默认 Logger/CORS/Recovery,异常恢复返回稳定 JSON 且不记录
Authorization、Cookie 或 panic 内容。
SQLite 默认文件为被忽略的 `backend-api/var/cmroubao.db`,连接启用 foreign keys、
5 秒 busy timeout、WAL 和 immediate transaction,并限制单连接以匹配单进程 MVP。
数据库由 `cmd` 显式打开和关闭,不存在包级单例。Goose SQL 通过 `embed.FS` 加载,
`cmd/migrate` 显式执行 `up/down/status`;T-201 只验证迁移链路,业务表由后续任务
按 API 和领域模型建立。
### 2.2 Android App
建议模块: