mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-25 10:30:25 +08:00
fix: 机器文件内容写入导致内容清空、feat: ioc支持根据类型注入
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package ioc
|
||||
|
||||
import "reflect"
|
||||
|
||||
type ComponentOption func(component *Component)
|
||||
|
||||
// 组件名
|
||||
@@ -13,6 +15,8 @@ func WithComponentName(name string) ComponentOption {
|
||||
type Component struct {
|
||||
Name string // 组件名
|
||||
|
||||
Type reflect.Type // 组件类型
|
||||
|
||||
Value any // 组件实例
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user