This commit is contained in:
2025-11-05 23:58:50 +08:00
parent 4eeaec45c4
commit cb18e27f18
20 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
- **`internal/app/api/api.go` (`API`)**:
- [x] 修改 `NewAPI` 函数,移除 `logger` 参数,改为接收 `ctx context.Context`
- [x] 移除 `API` 结构体中的 `logger` 成员,改为保存 `Ctx context.Context`
- [x] 为 `API` 组件本身创建 `Ctx``Ctx := logs.AddCompName(ctx, 'API')`,并传递给所有 `Controller`
的构造函数。
- [x] 改造 `Start` 方法,从 `a.Ctx` 获取 `logger` 实例进行日志记录。
- [x] 改造 `Stop` 方法,从 `a.Ctx` 获取 `logger` 实例进行日志记录。
- **`internal/app/api/router.go`
- [x] 改造 `setupRoutes` 方法,从 `a.Ctx` 获取 `logger` 实例进行日志记录。