diff --git a/common/pkgs/mq/scanner/event/event.go b/common/pkgs/mq/scanner/event/event.go index d989d5f..67b8278 100644 --- a/common/pkgs/mq/scanner/event/event.go +++ b/common/pkgs/mq/scanner/event/event.go @@ -1,15 +1,14 @@ package event import ( + "gitlink.org.cn/cloudream/common/pkgs/types" myreflect "gitlink.org.cn/cloudream/common/utils/reflect" - "gitlink.org.cn/cloudream/common/utils/serder" ) type Event interface{} -var eventUnionEles = serder.NewTypeNameResolver(true) -var EventTypeUnino = serder.NewTypeUnion[Event]("@type", eventUnionEles) +var EventTypeUnino = types.NewTypeUnion[Event]() func Register[T any]() { - eventUnionEles.Register(myreflect.TypeOf[T]()) + EventTypeUnino.Add(myreflect.TypeOf[T]()) }