From 6662d8e3bc0995d9805b106b01280b28c5997cc9 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Fri, 30 Jun 2023 14:29:25 +0800 Subject: [PATCH] use Entry[T]() function to add entry to go-mir --- auto/api/v1/admin.go | 13 ------------- auto/api/v1/core.go | 13 +++++++++++++ mirc/admin/v1/user.go | 2 +- mirc/bot/v1/user.go | 2 +- mirc/localoss/v1/user.go | 2 +- mirc/space/v1/user.go | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/auto/api/v1/admin.go b/auto/api/v1/admin.go index ad4ac308..4e5658a0 100644 --- a/auto/api/v1/admin.go +++ b/auto/api/v1/admin.go @@ -12,19 +12,6 @@ import ( "github.com/rocboss/paopao-ce/internal/model/web" ) -type _binding_ interface { - Bind(*gin.Context) mir.Error -} - -type _render_ interface { - Render(*gin.Context) -} - -type _default_ interface { - Bind(*gin.Context, any) mir.Error - Render(*gin.Context, any, mir.Error) -} - type Admin interface { _default_ diff --git a/auto/api/v1/core.go b/auto/api/v1/core.go index 159e938f..cb49743e 100644 --- a/auto/api/v1/core.go +++ b/auto/api/v1/core.go @@ -12,6 +12,19 @@ import ( "github.com/rocboss/paopao-ce/internal/model/web" ) +type _binding_ interface { + Bind(*gin.Context) mir.Error +} + +type _render_ interface { + Render(*gin.Context) +} + +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) +} + type Core interface { _default_ diff --git a/mirc/admin/v1/user.go b/mirc/admin/v1/user.go index c8e690e8..90dbdab9 100644 --- a/mirc/admin/v1/user.go +++ b/mirc/admin/v1/user.go @@ -6,7 +6,7 @@ import ( ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { diff --git a/mirc/bot/v1/user.go b/mirc/bot/v1/user.go index ffe4d8da..11c7330f 100644 --- a/mirc/bot/v1/user.go +++ b/mirc/bot/v1/user.go @@ -6,7 +6,7 @@ import ( ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { diff --git a/mirc/localoss/v1/user.go b/mirc/localoss/v1/user.go index e7380750..af558fd6 100644 --- a/mirc/localoss/v1/user.go +++ b/mirc/localoss/v1/user.go @@ -6,7 +6,7 @@ import ( ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { diff --git a/mirc/space/v1/user.go b/mirc/space/v1/user.go index f54c3298..64fd8c7f 100644 --- a/mirc/space/v1/user.go +++ b/mirc/space/v1/user.go @@ -6,7 +6,7 @@ import ( ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct {