feat(app): 引入 uber-go/fx 重构 DI 装配层
This commit is contained in:
15
internal/app/service_module.go
Normal file
15
internal/app/service_module.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package app
|
||||
|
||||
// ServiceModule 已在阶段4移除。
|
||||
//
|
||||
// 当前阶段,Service 由 internal/container.Container 内部构造(Container 聚合了
|
||||
// 所有 fx 注入的基础设施,在其 NewContainer 方法里创建 Repository 与 Service)。
|
||||
//
|
||||
// TODO(阶段6): 当 Handler 解耦为直接依赖各 Service 接口后,Container 将被移除,
|
||||
// 届时 Service 将回到此 Module 由 fx 直接管理:
|
||||
//
|
||||
// var ServiceModule = fx.Options(
|
||||
// fx.Provide(service.NewUserService),
|
||||
// fx.Provide(service.NewProfileService),
|
||||
// ...
|
||||
// )
|
||||
Reference in New Issue
Block a user