refactor all service dependency injection

This commit is contained in:
2026-08-10 11:35:48 +08:00
parent 007a7ba38a
commit c883cc52a2
152 changed files with 1030 additions and 223 deletions

View File

@@ -8,10 +8,17 @@ import (
type Config = config.SrvConfig
func Expose(engine *gin.Engine, cfg *Config) error {
if cfg != nil {
config.Spec = *cfg
type ExposeOptions struct {
Dependencies
Engine *gin.Engine
Config *Config
}
func Expose(options ExposeOptions) error {
applyDependencies(options.Dependencies)
if options.Config != nil {
config.Spec = *options.Config
}
routers.Register("fts", engine)
routers.Register("fts", options.Engine)
return nil
}