From 4600fcc1e24a110b0ac164676f33cf5d5de19ed8 Mon Sep 17 00:00:00 2001 From: alimy Date: Sun, 11 May 2025 17:44:10 +0800 Subject: [PATCH] upgrade go-mir to github.com/alimy/mir/v5 v5.0.0-alpha.2 --- auto/api/m/v1/user.go | 8 ++-- auto/api/r/v1/user.go | 8 ++-- auto/api/s/v1/user.go | 10 ++--- auto/api/v1/admin.go | 8 ++-- auto/api/v1/alipay_priv.go | 10 ++--- auto/api/v1/alipay_pub.go | 6 +-- auto/api/v1/core.go | 36 +++++++++--------- auto/api/v1/followship.go | 12 +++--- auto/api/v1/friendship.go | 14 +++---- auto/api/v1/loose.go | 16 ++++---- auto/api/v1/priv.go | 52 ++++++++++++------------- auto/api/v1/pub.go | 4 +- auto/api/v1/relax.go | 6 +-- auto/api/v1/site.go | 8 ++-- auto/api/v1/trends.go | 6 +-- auto/api/x/v1/user.go | 8 ++-- go.mod | 15 ++++---- go.sum | 32 ++++++++-------- internal/model/web/alipay.go | 2 +- internal/model/web/core.go | 2 +- internal/model/web/loose.go | 2 +- internal/model/web/priv.go | 2 +- internal/model/web/utils.go | 2 +- internal/model/web/web.go | 2 +- internal/servants/base/base.go | 2 +- internal/servants/web/admin.go | 2 +- internal/servants/web/alipay.go | 2 +- internal/servants/web/core.go | 2 +- internal/servants/web/followship.go | 2 +- internal/servants/web/friendship.go | 2 +- internal/servants/web/loose.go | 2 +- internal/servants/web/priv.go | 2 +- internal/servants/web/pub.go | 2 +- internal/servants/web/relax.go | 2 +- internal/servants/web/site.go | 2 +- internal/servants/web/trends.go | 2 +- internal/servants/web/utils.go | 2 +- mirc/admin/v1/user.go | 15 +++----- mirc/bot/v1/user.go | 15 +++----- mirc/gen.go | 18 +++------ mirc/localoss/v1/user.go | 16 +++----- mirc/space/v1/user.go | 15 +++----- mirc/web/v1/admin.go | 15 +++----- mirc/web/v1/alipay.go | 21 ++++------ mirc/web/v1/core.go | 43 ++++++++++----------- mirc/web/v1/followship.go | 19 ++++------ mirc/web/v1/friendship.go | 21 ++++------ mirc/web/v1/loose.go | 23 +++++------ mirc/web/v1/priv.go | 59 +++++++++++++---------------- mirc/web/v1/pub.go | 10 ++--- mirc/web/v1/relax.go | 13 ++----- mirc/web/v1/site.go | 14 +++---- mirc/web/v1/trends.go | 13 ++----- pkg/xerror/xerror.go | 2 +- 54 files changed, 275 insertions(+), 354 deletions(-) diff --git a/auto/api/m/v1/user.go b/auto/api/m/v1/user.go index bea939a4..a7f3c208 100644 --- a/auto/api/m/v1/user.go +++ b/auto/api/m/v1/user.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" ) @@ -69,7 +69,7 @@ func RegisterUserServant(e *gin.Engine, s User) { router.Use(middlewares...) // register routes info to router - router.Handle("POST", "/user/logout/", func(c *gin.Context) { + router.Handle("POST", "user/logout", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -78,7 +78,7 @@ func RegisterUserServant(e *gin.Engine, s User) { s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { + router.Handle("POST", "user/login", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/r/v1/user.go b/auto/api/r/v1/user.go index 82850dc2..0025c283 100644 --- a/auto/api/r/v1/user.go +++ b/auto/api/r/v1/user.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" ) @@ -69,7 +69,7 @@ func RegisterUserServant(e *gin.Engine, s User) { router.Use(middlewares...) // register routes info to router - router.Handle("POST", "/user/logout/", func(c *gin.Context) { + router.Handle("POST", "user/logout", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -78,7 +78,7 @@ func RegisterUserServant(e *gin.Engine, s User) { s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { + router.Handle("POST", "user/login", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/s/v1/user.go b/auto/api/s/v1/user.go index ac25628d..6f22345d 100644 --- a/auto/api/s/v1/user.go +++ b/auto/api/s/v1/user.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" ) @@ -64,7 +64,7 @@ func RegisterUserServant(e *gin.Engine, s User) { router := e.Group("s/v1") // register routes info to router - router.Handle("POST", "/user/logout/", func(c *gin.Context) { + router.Handle("POST", "user/logout", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -73,7 +73,7 @@ func RegisterUserServant(e *gin.Engine, s User) { s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { + router.Handle("POST", "user/login", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -87,7 +87,7 @@ func RegisterUserServant(e *gin.Engine, s User) { resp, err := s.Login(req) s.Render(c, resp, err) }) - router.Handle("GET", "/index/", func(c *gin.Context) { + router.Handle("GET", "index", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/admin.go b/auto/api/v1/admin.go index b3c208c7..733d19f6 100644 --- a/auto/api/v1/admin.go +++ b/auto/api/v1/admin.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -46,7 +46,7 @@ func RegisterAdminServant(e *gin.Engine, s Admin) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/admin/site/status", func(c *gin.Context) { + router.Handle("GET", "admin/site/status", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -60,7 +60,7 @@ func RegisterAdminServant(e *gin.Engine, s Admin) { resp, err := s.SiteInfo(req) s.Render(c, resp, err) }) - router.Handle("POST", "/admin/user/status", func(c *gin.Context) { + router.Handle("POST", "admin/user/status", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/alipay_priv.go b/auto/api/v1/alipay_priv.go index 86669b89..43347cbb 100644 --- a/auto/api/v1/alipay_priv.go +++ b/auto/api/v1/alipay_priv.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -33,7 +33,7 @@ func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/user/wallet/bills", func(c *gin.Context) { + router.Handle("GET", "user/wallet/bills", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -48,7 +48,7 @@ func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) { resp, err := s.UserWalletBills(req) s.Render(c, resp, err) }) - router.Handle("GET", "/user/recharge", func(c *gin.Context) { + router.Handle("GET", "user/recharge", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -63,7 +63,7 @@ func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) { resp, err := s.UserRechargeResult(req) s.Render(c, resp, err) }) - router.Handle("POST", "/user/recharge", func(c *gin.Context) { + router.Handle("POST", "user/recharge", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/alipay_pub.go b/auto/api/v1/alipay_pub.go index f4bbde51..56d23040 100644 --- a/auto/api/v1/alipay_pub.go +++ b/auto/api/v1/alipay_pub.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -25,7 +25,7 @@ func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub) { router := e.Group("v1") // register routes info to router - router.Handle("POST", "/alipay/notify", func(c *gin.Context) { + router.Handle("POST", "alipay/notify", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/core.go b/auto/api/v1/core.go index cd564736..f933fb3b 100644 --- a/auto/api/v1/core.go +++ b/auto/api/v1/core.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -46,7 +46,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/post/collection", func(c *gin.Context) { + router.Handle("GET", "post/collection", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -61,7 +61,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.TweetCollectionStatus(req) s.Render(c, resp, err) }) - router.Handle("GET", "/post/star", func(c *gin.Context) { + router.Handle("GET", "post/star", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -76,7 +76,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.TweetStarStatus(req) s.Render(c, resp, err) }) - router.Handle("GET", "/suggest/tags", func(c *gin.Context) { + router.Handle("GET", "suggest/tags", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -91,7 +91,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.SuggestTags(req) s.Render(c, resp, err) }) - router.Handle("GET", "/suggest/users", func(c *gin.Context) { + router.Handle("GET", "suggest/users", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -106,7 +106,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.SuggestUsers(req) s.Render(c, resp, err) }) - router.Handle("POST", "/user/avatar", func(c *gin.Context) { + router.Handle("POST", "user/avatar", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -119,7 +119,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.ChangeAvatar(req)) }) - router.Handle("POST", "/user/nickname", func(c *gin.Context) { + router.Handle("POST", "user/nickname", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -132,7 +132,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.ChangeNickname(req)) }) - router.Handle("POST", "/user/password", func(c *gin.Context) { + router.Handle("POST", "user/password", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -145,7 +145,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.ChangePassword(req)) }) - router.Handle("POST", "/user/phone", func(c *gin.Context) { + router.Handle("POST", "user/phone", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -158,7 +158,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.UserPhoneBind(req)) }) - router.Handle("GET", "/user/stars", func(c *gin.Context) { + router.Handle("GET", "user/stars", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -173,7 +173,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.GetStars(req) s.Render(c, resp, err) }) - router.Handle("GET", "/user/collections", func(c *gin.Context) { + router.Handle("GET", "user/collections", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -188,7 +188,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.GetCollections(req) s.Render(c, resp, err) }) - router.Handle("POST", "/user/whisper", func(c *gin.Context) { + router.Handle("POST", "user/whisper", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -201,7 +201,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.SendUserWhisper(req)) }) - router.Handle("POST", "/user/message/readall", func(c *gin.Context) { + router.Handle("POST", "user/message/readall", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -214,7 +214,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.ReadAllMessage(req)) }) - router.Handle("POST", "/user/message/read", func(c *gin.Context) { + router.Handle("POST", "user/message/read", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -227,7 +227,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.ReadMessage(req)) }) - router.Handle("GET", "/user/messages", func(c *gin.Context) { + router.Handle("GET", "user/messages", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -246,7 +246,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { var rv _render_ = resp rv.Render(c) }) - router.Handle("GET", "/user/info", func(c *gin.Context) { + router.Handle("GET", "user/info", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -261,7 +261,7 @@ func RegisterCoreServant(e *gin.Engine, s Core) { resp, err := s.GetUserInfo(req) s.Render(c, resp, err) }) - router.Handle("GET", "/sync/index", func(c *gin.Context) { + router.Handle("GET", "sync/index", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/followship.go b/auto/api/v1/followship.go index f1787fc4..208b9d90 100644 --- a/auto/api/v1/followship.go +++ b/auto/api/v1/followship.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -34,7 +34,7 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/user/followings", func(c *gin.Context) { + router.Handle("GET", "user/followings", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -48,7 +48,7 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship) { resp, err := s.ListFollowings(req) s.Render(c, resp, err) }) - router.Handle("GET", "/user/follows", func(c *gin.Context) { + router.Handle("GET", "user/follows", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -62,7 +62,7 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship) { resp, err := s.ListFollows(req) s.Render(c, resp, err) }) - router.Handle("POST", "/user/unfollow", func(c *gin.Context) { + router.Handle("POST", "user/unfollow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -75,7 +75,7 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship) { } s.Render(c, nil, s.UnfollowUser(req)) }) - router.Handle("POST", "/user/follow", func(c *gin.Context) { + router.Handle("POST", "user/follow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/friendship.go b/auto/api/v1/friendship.go index 78747933..b288249c 100644 --- a/auto/api/v1/friendship.go +++ b/auto/api/v1/friendship.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -35,7 +35,7 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/user/contacts", func(c *gin.Context) { + router.Handle("GET", "user/contacts", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -49,7 +49,7 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship) { resp, err := s.GetContacts(req) s.Render(c, resp, err) }) - router.Handle("POST", "/friend/delete", func(c *gin.Context) { + router.Handle("POST", "friend/delete", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -62,7 +62,7 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship) { } s.Render(c, nil, s.DeleteFriend(req)) }) - router.Handle("POST", "/friend/reject", func(c *gin.Context) { + router.Handle("POST", "friend/reject", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -75,7 +75,7 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship) { } s.Render(c, nil, s.RejectFriend(req)) }) - router.Handle("POST", "/friend/add", func(c *gin.Context) { + router.Handle("POST", "friend/add", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -88,7 +88,7 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship) { } s.Render(c, nil, s.AddFriend(req)) }) - router.Handle("POST", "/friend/requesting", func(c *gin.Context) { + router.Handle("POST", "friend/requesting", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/loose.go b/auto/api/v1/loose.go index 80d4f4ae..3794051b 100644 --- a/auto/api/v1/loose.go +++ b/auto/api/v1/loose.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -36,7 +36,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/post", func(c *gin.Context) { + router.Handle("GET", "post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -50,7 +50,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { resp, err := s.TweetDetail(req) s.Render(c, resp, err) }) - router.Handle("GET", "/post/comments", func(c *gin.Context) { + router.Handle("GET", "post/comments", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -69,7 +69,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { var rv _render_ = resp rv.Render(c) }) - router.Handle("GET", "/tags", func(c *gin.Context) { + router.Handle("GET", "tags", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -83,7 +83,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { resp, err := s.TopicList(req) s.Render(c, resp, err) }) - router.Handle("GET", "/user/profile", func(c *gin.Context) { + router.Handle("GET", "user/profile", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -97,7 +97,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { resp, err := s.GetUserProfile(req) s.Render(c, resp, err) }) - router.Handle("GET", "/user/posts", func(c *gin.Context) { + router.Handle("GET", "user/posts", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -116,7 +116,7 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { var rv _render_ = resp rv.Render(c) }) - router.Handle("GET", "/posts", func(c *gin.Context) { + router.Handle("GET", "posts", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/priv.go b/auto/api/v1/priv.go index a48ef256..8ebfc91f 100644 --- a/auto/api/v1/priv.go +++ b/auto/api/v1/priv.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -66,7 +66,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { router.Use(middlewares...) // register routes info to router - router.Handle("POST", "/topic/unfollow", func(c *gin.Context) { + router.Handle("POST", "topic/unfollow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -79,7 +79,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.UnfollowTopic(req)) }) - router.Handle("POST", "/topic/follow", func(c *gin.Context) { + router.Handle("POST", "topic/follow", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -92,7 +92,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.FollowTopic(req)) }) - router.Handle("POST", "/topic/pin", func(c *gin.Context) { + router.Handle("POST", "topic/pin", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -106,7 +106,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.PinTopic(req) s.Render(c, resp, err) }) - router.Handle("POST", "/topic/stick", func(c *gin.Context) { + router.Handle("POST", "topic/stick", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -120,7 +120,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.StickTopic(req) s.Render(c, resp, err) }) - router.Handle("POST", "/tweet/reply/thumbsdown", func(c *gin.Context) { + router.Handle("POST", "tweet/reply/thumbsdown", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -133,7 +133,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.ThumbsDownTweetReply(req)) }) - router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) { + router.Handle("POST", "tweet/reply/thumbsup", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -146,7 +146,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.ThumbsUpTweetReply(req)) }) - router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) { + router.Handle("POST", "tweet/comment/thumbsdown", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -159,7 +159,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.ThumbsDownTweetComment(req)) }) - router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) { + router.Handle("POST", "tweet/comment/thumbsup", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -172,7 +172,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.ThumbsUpTweetComment(req)) }) - router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) { + router.Handle("DELETE", "post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -185,7 +185,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.DeleteCommentReply(req)) }) - router.Handle("POST", "/post/comment/reply", func(c *gin.Context) { + router.Handle("POST", "post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -200,7 +200,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.CreateCommentReply(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/comment/highlight", func(c *gin.Context) { + router.Handle("POST", "post/comment/highlight", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -214,7 +214,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.HighlightComment(req) s.Render(c, resp, err) }) - router.Handle("DELETE", "/post/comment", func(c *gin.Context) { + router.Handle("DELETE", "post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -227,7 +227,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.DeleteComment(req)) }) - router.Handle("POST", "/post/comment", func(c *gin.Context) { + router.Handle("POST", "post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -242,7 +242,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.CreateComment(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/visibility", func(c *gin.Context) { + router.Handle("POST", "post/visibility", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -256,7 +256,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.VisibleTweet(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/highlight", func(c *gin.Context) { + router.Handle("POST", "post/highlight", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -270,7 +270,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.HighlightTweet(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/stick", func(c *gin.Context) { + router.Handle("POST", "post/stick", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -284,7 +284,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.StickTweet(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/lock", func(c *gin.Context) { + router.Handle("POST", "post/lock", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -298,7 +298,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.LockTweet(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/collection", func(c *gin.Context) { + router.Handle("POST", "post/collection", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -312,7 +312,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.CollectionTweet(req) s.Render(c, resp, err) }) - router.Handle("POST", "/post/star", func(c *gin.Context) { + router.Handle("POST", "post/star", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -326,7 +326,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.StarTweet(req) s.Render(c, resp, err) }) - router.Handle("DELETE", "/post", func(c *gin.Context) { + router.Handle("DELETE", "post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -339,7 +339,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { } s.Render(c, nil, s.DeleteTweet(req)) }) - router.Handle("POST", "/post", append(cc.ChainCreateTweet(), func(c *gin.Context) { + router.Handle("POST", "post", append(cc.ChainCreateTweet(), func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -359,7 +359,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { var rv _render_ = resp rv.Render(c) })...) - router.Handle("GET", "/attachment", func(c *gin.Context) { + router.Handle("GET", "attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -374,7 +374,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.DownloadAttachment(req) s.Render(c, resp, err) }) - router.Handle("GET", "/attachment/precheck", func(c *gin.Context) { + router.Handle("GET", "attachment/precheck", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -389,7 +389,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { resp, err := s.DownloadAttachmentPrecheck(req) s.Render(c, resp, err) }) - router.Handle("POST", "/attachment", func(c *gin.Context) { + router.Handle("POST", "attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/pub.go b/auto/api/v1/pub.go index 28abcb46..2d9274d2 100644 --- a/auto/api/v1/pub.go +++ b/auto/api/v1/pub.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) diff --git a/auto/api/v1/relax.go b/auto/api/v1/relax.go index 65aac2aa..e1a3f0cc 100644 --- a/auto/api/v1/relax.go +++ b/auto/api/v1/relax.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -43,7 +43,7 @@ func RegisterRelaxServant(e *gin.Engine, s Relax, m ...RelaxChain) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/user/msgcount/unread", append(cc.ChainGetUnreadMsgCount(), func(c *gin.Context) { + router.Handle("GET", "user/msgcount/unread", append(cc.ChainGetUnreadMsgCount(), func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/site.go b/auto/api/v1/site.go index ba523c2d..918ba2ae 100644 --- a/auto/api/v1/site.go +++ b/auto/api/v1/site.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/model/web" @@ -27,7 +27,7 @@ func RegisterSiteServant(e *gin.Engine, s Site) { router := e.Group("v1") // register routes info to router - router.Handle("GET", "/site/profile", func(c *gin.Context) { + router.Handle("GET", "site/profile", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -37,7 +37,7 @@ func RegisterSiteServant(e *gin.Engine, s Site) { resp, err := s.Profile() s.Render(c, resp, err) }) - router.Handle("GET", "/site/version", func(c *gin.Context) { + router.Handle("GET", "site/version", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/v1/trends.go b/auto/api/v1/trends.go index 959fa317..b7f26b58 100644 --- a/auto/api/v1/trends.go +++ b/auto/api/v1/trends.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) @@ -31,7 +31,7 @@ func RegisterTrendsServant(e *gin.Engine, s Trends) { router.Use(middlewares...) // register routes info to router - router.Handle("GET", "/trends/index", func(c *gin.Context) { + router.Handle("GET", "trends/index", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/auto/api/x/v1/user.go b/auto/api/x/v1/user.go index a6ae9a58..963fd3a3 100644 --- a/auto/api/x/v1/user.go +++ b/auto/api/x/v1/user.go @@ -1,13 +1,13 @@ // Code generated by go-mir. DO NOT EDIT. // versions: -// - mir v4.2.0 +// - mir 5.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" ) @@ -69,7 +69,7 @@ func RegisterUserServant(e *gin.Engine, s User) { router.Use(middlewares...) // register routes info to router - router.Handle("POST", "/user/logout/", func(c *gin.Context) { + router.Handle("POST", "user/logout", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -78,7 +78,7 @@ func RegisterUserServant(e *gin.Engine, s User) { s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { + router.Handle("POST", "user/login", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return diff --git a/go.mod b/go.mod index 7ec71701..a80873c2 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/RoaringBitmap/roaring v1.9.4 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 - github.com/alimy/mir/v4 v4.2.0-alpha.5 + github.com/alimy/mir/v5 v5.0.0-alpha.2 github.com/alimy/tryst v1.1.0 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/allegro/bigcache/v3 v3.1.0 @@ -52,7 +52,7 @@ require ( go.opentelemetry.io/otel/sdk/log v0.10.0 go.opentelemetry.io/otel/sdk/metric v1.34.0 go.uber.org/automaxprocs v1.5.3 - golang.org/x/crypto v0.36.0 + golang.org/x/crypto v0.38.0 google.golang.org/grpc v1.71.1 google.golang.org/protobuf v1.36.4 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -160,12 +160,13 @@ require ( golang.org/x/arch v0.8.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/sync v0.12.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect + golang.org/x/mod v0.24.0 // indirect + golang.org/x/net v0.40.0 // indirect + golang.org/x/sync v0.14.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.25.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/tools v0.33.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 8981a9ab..aa31cdc2 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/RoaringBitmap/roaring v1.9.4 h1:yhEIoH4YezLYT04s1nHehNO64EKFTop/wBhxv github.com/RoaringBitmap/roaring v1.9.4/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 h1:uFrPOl1VBt/Abfl2z+A/DFc+AwmFLxEHR1+Yq6cXvww= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868/go.mod h1:srphKZ1i+yGXxl/LpBS7ZIECTjCTPzZzAMtJWoG3sLo= -github.com/alimy/mir/v4 v4.2.0-alpha.5 h1:ExSJpbFzKX3Avk1CoTOU3OLyvo4PTB2SnTSQXfeJNIc= -github.com/alimy/mir/v4 v4.2.0-alpha.5/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= +github.com/alimy/mir/v5 v5.0.0-alpha.2 h1:FWynGRqSV3tENJdG2wvYC2q8RUitneHDuokypAFE5So= +github.com/alimy/mir/v5 v5.0.0-alpha.2/go.mod h1:R76XQiU3K7T4V0aOcd4r5OeO7Gf8yTIVtnLbt1LLf2U= github.com/alimy/tryst v1.1.0 h1:EiGiTLLw9n6bfg1WwnqoZTb1gnDHDHxozjfE/cuVjlI= github.com/alimy/tryst v1.1.0/go.mod h1:t/Ocn3Qd2P8Sg5VIL11s1H7cBCYZcDy+VNwiFHix+lI= github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g= @@ -383,8 +383,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -394,8 +394,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -409,15 +409,15 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= +golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= +golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -435,8 +435,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -450,8 +450,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -460,8 +460,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/model/web/alipay.go b/internal/model/web/alipay.go index 6bfa674f..0d21b428 100644 --- a/internal/model/web/alipay.go +++ b/internal/model/web/alipay.go @@ -7,7 +7,7 @@ package web import ( "context" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/servants/base" diff --git a/internal/model/web/core.go b/internal/model/web/core.go index 67a43b6a..6ff66280 100644 --- a/internal/model/web/core.go +++ b/internal/model/web/core.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/model/joint" diff --git a/internal/model/web/loose.go b/internal/model/web/loose.go index 8ca847f0..936c43ea 100644 --- a/internal/model/web/loose.go +++ b/internal/model/web/loose.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" diff --git a/internal/model/web/priv.go b/internal/model/web/priv.go index cbe38d00..2c930aeb 100644 --- a/internal/model/web/priv.go +++ b/internal/model/web/priv.go @@ -10,7 +10,7 @@ import ( "net/http" "strings" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core/cs" diff --git a/internal/model/web/utils.go b/internal/model/web/utils.go index e1b5d983..6c53da33 100644 --- a/internal/model/web/utils.go +++ b/internal/model/web/utils.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/rocboss/paopao-ce/pkg/xerror" ) diff --git a/internal/model/web/web.go b/internal/model/web/web.go index d197bb19..513da35e 100644 --- a/internal/model/web/web.go +++ b/internal/model/web/web.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/servants/base" diff --git a/internal/servants/base/base.go b/internal/servants/base/base.go index 3f4d9d10..a9cca117 100644 --- a/internal/servants/base/base.go +++ b/internal/servants/base/base.go @@ -10,7 +10,7 @@ import ( "math" "net/http" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/cockroachdb/errors" "github.com/getsentry/sentry-go" sentrygin "github.com/getsentry/sentry-go/gin" diff --git a/internal/servants/web/admin.go b/internal/servants/web/admin.go index 1e996ad5..787ab9b8 100644 --- a/internal/servants/web/admin.go +++ b/internal/servants/web/admin.go @@ -7,7 +7,7 @@ package web import ( "time" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" diff --git a/internal/servants/web/alipay.go b/internal/servants/web/alipay.go index a84a9bd9..88263639 100644 --- a/internal/servants/web/alipay.go +++ b/internal/servants/web/alipay.go @@ -7,7 +7,7 @@ package web import ( "fmt" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/model/web" diff --git a/internal/servants/web/core.go b/internal/servants/web/core.go index 4430f6ee..205c1a45 100644 --- a/internal/servants/web/core.go +++ b/internal/servants/web/core.go @@ -11,7 +11,7 @@ import ( "time" "unicode/utf8" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" diff --git a/internal/servants/web/followship.go b/internal/servants/web/followship.go index 0344841a..0e90612d 100644 --- a/internal/servants/web/followship.go +++ b/internal/servants/web/followship.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/dao/cache" diff --git a/internal/servants/web/friendship.go b/internal/servants/web/friendship.go index e0436b72..5cf4eca8 100644 --- a/internal/servants/web/friendship.go +++ b/internal/servants/web/friendship.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/model/web" diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index ac992d06..270203c7 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -7,7 +7,7 @@ package web import ( "fmt" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" diff --git a/internal/servants/web/priv.go b/internal/servants/web/priv.go index 492f9428..a86ecda1 100644 --- a/internal/servants/web/priv.go +++ b/internal/servants/web/priv.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/alimy/tryst/cfg" "github.com/disintegration/imaging" "github.com/gin-gonic/gin" diff --git a/internal/servants/web/pub.go b/internal/servants/web/pub.go index a1611034..b74f2d6a 100644 --- a/internal/servants/web/pub.go +++ b/internal/servants/web/pub.go @@ -14,7 +14,7 @@ import ( "unicode/utf8" "github.com/afocus/captcha" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gofrs/uuid/v5" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/core/ms" diff --git a/internal/servants/web/relax.go b/internal/servants/web/relax.go index 4c230f66..ea36f76b 100644 --- a/internal/servants/web/relax.go +++ b/internal/servants/web/relax.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" "github.com/redis/rueidis" api "github.com/rocboss/paopao-ce/auto/api/v1" diff --git a/internal/servants/web/site.go b/internal/servants/web/site.go index ce137fbf..d92608d9 100644 --- a/internal/servants/web/site.go +++ b/internal/servants/web/site.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/model/web" diff --git a/internal/servants/web/trends.go b/internal/servants/web/trends.go index 58171606..9c9ce7d2 100644 --- a/internal/servants/web/trends.go +++ b/internal/servants/web/trends.go @@ -7,7 +7,7 @@ package web import ( "fmt" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" diff --git a/internal/servants/web/utils.go b/internal/servants/web/utils.go index 596c0e92..9dd24267 100644 --- a/internal/servants/web/utils.go +++ b/internal/servants/web/utils.go @@ -11,7 +11,7 @@ import ( "time" "unicode/utf8" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" "github.com/gofrs/uuid/v5" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core/ms" diff --git a/mirc/admin/v1/user.go b/mirc/admin/v1/user.go index 90dbdab9..26daf0b7 100644 --- a/mirc/admin/v1/user.go +++ b/mirc/admin/v1/user.go @@ -1,14 +1,9 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" ) -func init() { - Entry[User]() -} - type AgentInfo struct { Platform string `json:"platform"` UserAgent string `json:"user_agent"` @@ -35,8 +30,8 @@ type LoginResp struct { } type User struct { - Chain `mir:"-"` - Group `mir:"m/v1"` - Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` - Logout func(Post) `mir:"/user/logout/"` + Schema `mir:"m/v1,chain"` + + Login func(Post, LoginReq) LoginResp `mir:"user/login"` + Logout func(Post) `mir:"user/logout"` } diff --git a/mirc/bot/v1/user.go b/mirc/bot/v1/user.go index 11c7330f..ff916444 100644 --- a/mirc/bot/v1/user.go +++ b/mirc/bot/v1/user.go @@ -1,14 +1,9 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" ) -func init() { - Entry[User]() -} - type AgentInfo struct { Platform string `json:"platform"` UserAgent string `json:"user_agent"` @@ -35,8 +30,8 @@ type LoginResp struct { } type User struct { - Chain `mir:"-"` - Group `mir:"r/v1"` - Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` - Logout func(Post) `mir:"/user/logout/"` + Schema `mir:"r/v1,chain"` + + Login func(Post, LoginReq) LoginResp `mir:"user/login"` + Logout func(Post) `mir:"user/logout"` } diff --git a/mirc/gen.go b/mirc/gen.go index dcd402ac..0e0009ac 100644 --- a/mirc/gen.go +++ b/mirc/gen.go @@ -10,28 +10,20 @@ package main import ( "log" - . "github.com/alimy/mir/v4/core" - . "github.com/alimy/mir/v4/engine" - "github.com/gin-gonic/gin" - - _ "github.com/rocboss/paopao-ce/mirc/admin/v1" - _ "github.com/rocboss/paopao-ce/mirc/bot/v1" - _ "github.com/rocboss/paopao-ce/mirc/localoss/v1" - _ "github.com/rocboss/paopao-ce/mirc/space/v1" - _ "github.com/rocboss/paopao-ce/mirc/web/v1" + . "github.com/alimy/mir/v5/core" + . "github.com/alimy/mir/v5/engine" ) //go:generate go run $GOFILE func main() { log.Println("[Mir] generate code start") - opts := Options{ + if err := Generate( + Schema("web", "space", "localoss", "bot", "admin"), UseGin(), SinkPath("../auto"), WatchCtxDone(true), RunMode(InSerialMode), - AssertType[*gin.Context](), - } - if err := Generate(opts); err != nil { + ); err != nil { log.Fatal(err) } log.Println("[Mir] generate code finish") diff --git a/mirc/localoss/v1/user.go b/mirc/localoss/v1/user.go index af558fd6..f71132ec 100644 --- a/mirc/localoss/v1/user.go +++ b/mirc/localoss/v1/user.go @@ -1,14 +1,9 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" ) -func init() { - Entry[User]() -} - type AgentInfo struct { Platform string `json:"platform"` UserAgent string `json:"user_agent"` @@ -35,8 +30,9 @@ type LoginResp struct { } type User struct { - Group `mir:"s/v1"` - Index func(Get) `mir:"/index/"` - Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` - Logout func(Post) `mir:"/user/logout/"` + Schema `mir:"s/v1"` + + Index func(Get) `mir:"index"` + Login func(Post, LoginReq) LoginResp `mir:"user/login"` + Logout func(Post) `mir:"user/logout"` } diff --git a/mirc/space/v1/user.go b/mirc/space/v1/user.go index 64fd8c7f..56b8372a 100644 --- a/mirc/space/v1/user.go +++ b/mirc/space/v1/user.go @@ -1,14 +1,9 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" ) -func init() { - Entry[User]() -} - type AgentInfo struct { Platform string `json:"platform"` UserAgent string `json:"user_agent"` @@ -35,8 +30,8 @@ type LoginResp struct { } type User struct { - Chain `mir:"-"` - Group `mir:"x/v1"` - Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` - Logout func(Post) `mir:"/user/logout/"` + Schema `mir:"x/v1,chain"` + + Login func(Post, LoginReq) LoginResp `mir:"user/login"` + Logout func(Post) `mir:"user/logout"` } diff --git a/mirc/web/v1/admin.go b/mirc/web/v1/admin.go index cbd71d26..87d43238 100644 --- a/mirc/web/v1/admin.go +++ b/mirc/web/v1/admin.go @@ -1,21 +1,16 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Admin]() -} - // Admin 运维相关服务 type Admin struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // ChangeUserStatus 管理·禁言/解封用户 - ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"/admin/user/status"` - SiteInfo func(Get, web.SiteInfoReq) web.SiteInfoResp `mir:"/admin/site/status"` + ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"admin/user/status"` + SiteInfo func(Get, web.SiteInfoReq) web.SiteInfoResp `mir:"admin/site/status"` } diff --git a/mirc/web/v1/alipay.go b/mirc/web/v1/alipay.go index 0234639b..fd391e58 100644 --- a/mirc/web/v1/alipay.go +++ b/mirc/web/v1/alipay.go @@ -1,34 +1,29 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - AddEntry(new(AlipayPub), new(AlipayPriv)) -} - // AlipayPub 支付宝相关不用授权的服务 type AlipayPub struct { - Group `mir:"v1"` + Schema `mir:"v1"` // AlipayNotify 支付宝回调 - AlipayNotify func(Post, web.AlipayNotifyReq) `mir:"/alipay/notify"` + AlipayNotify func(Post, web.AlipayNotifyReq) `mir:"alipay/notify"` } // AlipayPub 支付宝相关授权的服务 type AlipayPriv struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Schema `mir:"v1,chain"` // UserRechargeLink 用户充值 - UserRechargeLink func(Post, web.UserRechargeLinkReq) web.UserRechargeLinkResp `mir:"/user/recharge"` + UserRechargeLink func(Post, web.UserRechargeLinkReq) web.UserRechargeLinkResp `mir:"user/recharge"` // UserRechargeResult 获取充值结果 - UserRechargeResult func(Get, web.UserRechargeResultReq) web.UserRechargeResultResp `mir:"/user/recharge"` + UserRechargeResult func(Get, web.UserRechargeResultReq) web.UserRechargeResultResp `mir:"user/recharge"` // UserWalletBills 获取用户账单 - UserWalletBills func(Get, web.UserWalletBillsReq) web.UserWalletBillsResp `mir:"/user/wallet/bills"` + UserWalletBills func(Get, web.UserWalletBillsReq) web.UserWalletBillsResp `mir:"user/wallet/bills"` } diff --git a/mirc/web/v1/core.go b/mirc/web/v1/core.go index 28d93177..ec4bfd9a 100644 --- a/mirc/web/v1/core.go +++ b/mirc/web/v1/core.go @@ -1,65 +1,60 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Core]() -} - // Core 核心服务,需要授权访问 type Core struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // SyncSearchIndex 同步索引 - SyncSearchIndex func(Get, web.SyncSearchIndexReq) `mir:"/sync/index"` + SyncSearchIndex func(Get, web.SyncSearchIndexReq) `mir:"sync/index"` // GetUserInfo 获取当前用户信息 - GetUserInfo func(Get, web.UserInfoReq) web.UserInfoResp `mir:"/user/info"` + GetUserInfo func(Get, web.UserInfoReq) web.UserInfoResp `mir:"user/info"` // GetMessages 获取消息列表 - GetMessages func(Get, web.GetMessagesReq) web.GetMessagesResp `mir:"/user/messages"` + GetMessages func(Get, web.GetMessagesReq) web.GetMessagesResp `mir:"user/messages"` // ReadMessage 标记未读消息已读 - ReadMessage func(Post, web.ReadMessageReq) `mir:"/user/message/read"` + ReadMessage func(Post, web.ReadMessageReq) `mir:"user/message/read"` // ReadAllMessage 标记所有未读消息已读 - ReadAllMessage func(Post, web.ReadAllMessageReq) `mir:"/user/message/readall"` + ReadAllMessage func(Post, web.ReadAllMessageReq) `mir:"user/message/readall"` // SendUserWhisper 发送用户私信 - SendUserWhisper func(Post, web.SendWhisperReq) `mir:"/user/whisper"` + SendUserWhisper func(Post, web.SendWhisperReq) `mir:"user/whisper"` // GetCollections 获取用户收藏列表 - GetCollections func(Get, web.GetCollectionsReq) web.GetCollectionsResp `mir:"/user/collections"` + GetCollections func(Get, web.GetCollectionsReq) web.GetCollectionsResp `mir:"user/collections"` // GetStars 获取用户点赞列表 - GetStars func(Get, web.GetStarsReq) web.GetStarsResp `mir:"/user/stars"` + GetStars func(Get, web.GetStarsReq) web.GetStarsResp `mir:"user/stars"` // UserPhoneBind 绑定用户手机号 - UserPhoneBind func(Post, web.UserPhoneBindReq) `mir:"/user/phone"` + UserPhoneBind func(Post, web.UserPhoneBindReq) `mir:"user/phone"` // ChangePassword 修改密码 - ChangePassword func(Post, web.ChangePasswordReq) `mir:"/user/password"` + ChangePassword func(Post, web.ChangePasswordReq) `mir:"user/password"` // ChangeNickname 修改昵称 - ChangeNickname func(Post, web.ChangeNicknameReq) `mir:"/user/nickname"` + ChangeNickname func(Post, web.ChangeNicknameReq) `mir:"user/nickname"` // ChangeAvatar 修改头像 - ChangeAvatar func(Post, web.ChangeAvatarReq) `mir:"/user/avatar"` + ChangeAvatar func(Post, web.ChangeAvatarReq) `mir:"user/avatar"` // SuggestUsers 检索用户 - SuggestUsers func(Get, web.SuggestUsersReq) web.SuggestUsersResp `mir:"/suggest/users"` + SuggestUsers func(Get, web.SuggestUsersReq) web.SuggestUsersResp `mir:"suggest/users"` // SuggestTags 检索标签 - SuggestTags func(Get, web.SuggestTagsReq) web.SuggestTagsResp `mir:"/suggest/tags"` + SuggestTags func(Get, web.SuggestTagsReq) web.SuggestTagsResp `mir:"suggest/tags"` // TweetStarStatus 获取动态点赞状态 - TweetStarStatus func(Get, web.TweetStarStatusReq) web.TweetStarStatusResp `mir:"/post/star"` + TweetStarStatus func(Get, web.TweetStarStatusReq) web.TweetStarStatusResp `mir:"post/star"` // TweetCollectionStatus 获取动态收藏状态 - TweetCollectionStatus func(Get, web.TweetCollectionStatusReq) web.TweetCollectionStatusResp `mir:"/post/collection"` + TweetCollectionStatus func(Get, web.TweetCollectionStatusReq) web.TweetCollectionStatusResp `mir:"post/collection"` } diff --git a/mirc/web/v1/followship.go b/mirc/web/v1/followship.go index 9548b796..db5d81f7 100644 --- a/mirc/web/v1/followship.go +++ b/mirc/web/v1/followship.go @@ -1,29 +1,24 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Followship]() -} - // Followship 关注者模式 服务 type Followship struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // FollowUser 关注用户 - FollowUser func(Post, web.FollowUserReq) `mir:"/user/follow"` + FollowUser func(Post, web.FollowUserReq) `mir:"user/follow"` // UnfollowUser 取消关注用户 - UnfollowUser func(Post, web.UnfollowUserReq) `mir:"/user/unfollow"` + UnfollowUser func(Post, web.UnfollowUserReq) `mir:"user/unfollow"` // ListFollows 获取用户的关注列表 - ListFollows func(Get, web.ListFollowsReq) web.ListFollowsResp `mir:"/user/follows"` + ListFollows func(Get, web.ListFollowsReq) web.ListFollowsResp `mir:"user/follows"` // ListFollowings 获取用户的追随者列表 - ListFollowings func(Get, web.ListFollowingsReq) web.ListFollowingsResp `mir:"/user/followings"` + ListFollowings func(Get, web.ListFollowingsReq) web.ListFollowingsResp `mir:"user/followings"` } diff --git a/mirc/web/v1/friendship.go b/mirc/web/v1/friendship.go index 95ba3002..74d7439b 100644 --- a/mirc/web/v1/friendship.go +++ b/mirc/web/v1/friendship.go @@ -1,32 +1,27 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Friendship]() -} - // Friendship 好友模式 服务 type Friendship struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // RequestingFriend 请求添加朋友 - RequestingFriend func(Post, web.RequestingFriendReq) `mir:"/friend/requesting" binding:"json"` + RequestingFriend func(Post, web.RequestingFriendReq) `mir:"friend/requesting" binding:"json"` // AddFriend 同意添加好友 - AddFriend func(Post, web.AddFriendReq) `mir:"/friend/add" binding:"json"` + AddFriend func(Post, web.AddFriendReq) `mir:"friend/add" binding:"json"` // RejectFriend 拒绝添加好友 - RejectFriend func(Post, web.RejectFriendReq) `mir:"/friend/reject" binding:"json"` + RejectFriend func(Post, web.RejectFriendReq) `mir:"friend/reject" binding:"json"` // DeleteFriend 删除好友 - DeleteFriend func(Post, web.DeleteFriendReq) `mir:"/friend/delete" binding:"json"` + DeleteFriend func(Post, web.DeleteFriendReq) `mir:"friend/delete" binding:"json"` // GetContacts 获取好友列表 - GetContacts func(Get, web.GetContactsReq) web.GetContactsResp `mir:"/user/contacts"` + GetContacts func(Get, web.GetContactsReq) web.GetContactsResp `mir:"user/contacts"` } diff --git a/mirc/web/v1/loose.go b/mirc/web/v1/loose.go index 0c6ecf51..19b65a0a 100644 --- a/mirc/web/v1/loose.go +++ b/mirc/web/v1/loose.go @@ -1,35 +1,30 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Loose]() -} - // Loose 宽松授权的服务 type Loose struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // Timeline 获取广场流 - Timeline func(Get, web.TimelineReq) web.TimelineResp `mir:"/posts"` + Timeline func(Get, web.TimelineReq) web.TimelineResp `mir:"posts"` // GetUserTweets 获取用户动态列表 - GetUserTweets func(Get, web.GetUserTweetsReq) web.GetUserTweetsResp `mir:"/user/posts"` + GetUserTweets func(Get, web.GetUserTweetsReq) web.GetUserTweetsResp `mir:"user/posts"` // GetUserProfile 获取用户基本信息 - GetUserProfile func(Get, web.GetUserProfileReq) web.GetUserProfileResp `mir:"/user/profile"` + GetUserProfile func(Get, web.GetUserProfileReq) web.GetUserProfileResp `mir:"user/profile"` // TopicList 获取话题列表 - TopicList func(Get, web.TopicListReq) web.TopicListResp `mir:"/tags"` + TopicList func(Get, web.TopicListReq) web.TopicListResp `mir:"tags"` // TweetComments 获取动态评论 - TweetComments func(Get, web.TweetCommentsReq) web.TweetCommentsResp `mir:"/post/comments"` + TweetComments func(Get, web.TweetCommentsReq) web.TweetCommentsResp `mir:"post/comments"` // TweetDetail 获取动态详情 - TweetDetail func(Get, web.TweetDetailReq) web.TweetDetailResp `mir:"/post"` + TweetDetail func(Get, web.TweetDetailReq) web.TweetDetailResp `mir:"post"` } diff --git a/mirc/web/v1/priv.go b/mirc/web/v1/priv.go index 17f8c7a5..958bf6a0 100644 --- a/mirc/web/v1/priv.go +++ b/mirc/web/v1/priv.go @@ -1,89 +1,84 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Priv]() -} - // Priv 私有授权的服务 type Priv struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // UploadAttachment 上传资源 - UploadAttachment func(Post, web.UploadAttachmentReq) web.UploadAttachmentResp `mir:"/attachment"` + UploadAttachment func(Post, web.UploadAttachmentReq) web.UploadAttachmentResp `mir:"attachment"` // DownloadAttachmentPrecheck 下载资源预检 - DownloadAttachmentPrecheck func(Get, web.DownloadAttachmentPrecheckReq) web.DownloadAttachmentPrecheckResp `mir:"/attachment/precheck"` + DownloadAttachmentPrecheck func(Get, web.DownloadAttachmentPrecheckReq) web.DownloadAttachmentPrecheckResp `mir:"attachment/precheck"` // DownloadAttachment 下载资源 - DownloadAttachment func(Get, web.DownloadAttachmentReq) web.DownloadAttachmentResp `mir:"/attachment"` + DownloadAttachment func(Get, web.DownloadAttachmentReq) web.DownloadAttachmentResp `mir:"attachment"` // CreateTweet 发布动态 - CreateTweet func(Post, Chain, web.CreateTweetReq) web.CreateTweetResp `mir:"/post"` + CreateTweet func(Post, Chain, web.CreateTweetReq) web.CreateTweetResp `mir:"post"` // DeleteTweet 删除动态 - DeleteTweet func(Delete, web.DeleteTweetReq) `mir:"/post"` + DeleteTweet func(Delete, web.DeleteTweetReq) `mir:"post"` // StarTweet 动态点赞操作 - StarTweet func(Post, web.StarTweetReq) web.StarTweetResp `mir:"/post/star"` + StarTweet func(Post, web.StarTweetReq) web.StarTweetResp `mir:"post/star"` // CollectionTweet 动态收藏操作 - CollectionTweet func(Post, web.CollectionTweetReq) web.CollectionTweetResp `mir:"/post/collection"` + CollectionTweet func(Post, web.CollectionTweetReq) web.CollectionTweetResp `mir:"post/collection"` // LockTweet 锁定动态 - LockTweet func(Post, web.LockTweetReq) web.LockTweetResp `mir:"/post/lock"` + LockTweet func(Post, web.LockTweetReq) web.LockTweetResp `mir:"post/lock"` // StickTweet 置顶动态 - StickTweet func(Post, web.StickTweetReq) web.StickTweetResp `mir:"/post/stick"` + StickTweet func(Post, web.StickTweetReq) web.StickTweetResp `mir:"post/stick"` // HighlightTweet 推文亮点设置 - HighlightTweet func(Post, web.HighlightTweetReq) web.HighlightTweetResp `mir:"/post/highlight"` + HighlightTweet func(Post, web.HighlightTweetReq) web.HighlightTweetResp `mir:"post/highlight"` // VisibleTweet 修改动态可见度 - VisibleTweet func(Post, web.VisibleTweetReq) web.VisibleTweetResp `mir:"/post/visibility"` + VisibleTweet func(Post, web.VisibleTweetReq) web.VisibleTweetResp `mir:"post/visibility"` // CreateTweetComment 发布动态评论 - CreateComment func(Post, web.CreateCommentReq) web.CreateCommentResp `mir:"/post/comment"` + CreateComment func(Post, web.CreateCommentReq) web.CreateCommentResp `mir:"post/comment"` // DeletePostComment 删除动态评论 - DeleteComment func(Delete, web.DeleteCommentReq) `mir:"/post/comment"` + DeleteComment func(Delete, web.DeleteCommentReq) `mir:"post/comment"` // HighlightComment 精选动态评论 - HighlightComment func(Post, web.HighlightCommentReq) web.HighlightCommentResp `mir:"/post/comment/highlight"` + HighlightComment func(Post, web.HighlightCommentReq) web.HighlightCommentResp `mir:"post/comment/highlight"` // CreateCommentReply 发布评论回复 - CreateCommentReply func(Post, web.CreateCommentReplyReq) web.CreateCommentReplyResp `mir:"/post/comment/reply"` + CreateCommentReply func(Post, web.CreateCommentReplyReq) web.CreateCommentReplyResp `mir:"post/comment/reply"` // DeleteCommentReply 删除评论回复 - DeleteCommentReply func(Delete, web.DeleteCommentReplyReq) `mir:"/post/comment/reply"` + DeleteCommentReply func(Delete, web.DeleteCommentReplyReq) `mir:"post/comment/reply"` // ThumbsUpTweetComment 点赞评论 - ThumbsUpTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"/tweet/comment/thumbsup"` + ThumbsUpTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"tweet/comment/thumbsup"` // ThumbsDownTweetComment 点踩评论 - ThumbsDownTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"/tweet/comment/thumbsdown"` + ThumbsDownTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"tweet/comment/thumbsdown"` // ThumbsUpTweetReply 点赞评论回复· - ThumbsUpTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"/tweet/reply/thumbsup"` + ThumbsUpTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"tweet/reply/thumbsup"` // ThumbsDownTweetReply 点踩评论回复 - ThumbsDownTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"/tweet/reply/thumbsdown"` + ThumbsDownTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"tweet/reply/thumbsdown"` // StickTopic 置顶话题 - StickTopic func(Post, web.StickTopicReq) web.StickTopicResp `mir:"/topic/stick"` + StickTopic func(Post, web.StickTopicReq) web.StickTopicResp `mir:"topic/stick"` // PinTopic 钉住话题 - PinTopic func(Post, web.PinTopicReq) web.PinTopicResp `mir:"/topic/pin"` + PinTopic func(Post, web.PinTopicReq) web.PinTopicResp `mir:"topic/pin"` // FollowTopic 关注话题 - FollowTopic func(Post, web.FollowTopicReq) `mir:"/topic/follow"` + FollowTopic func(Post, web.FollowTopicReq) `mir:"topic/follow"` // UnfollowTopic 取消关注话题 - UnfollowTopic func(Post, web.UnfollowTopicReq) `mir:"/topic/unfollow"` + UnfollowTopic func(Post, web.UnfollowTopicReq) `mir:"topic/unfollow"` } diff --git a/mirc/web/v1/pub.go b/mirc/web/v1/pub.go index 60fb182d..2c6c5a05 100644 --- a/mirc/web/v1/pub.go +++ b/mirc/web/v1/pub.go @@ -1,18 +1,14 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Pub]() -} - // Pub 不用授权的公开服务 type Pub struct { - Group `mir:"v1"` + Schema `mir:"v1"` // Version 获取后台版本信息 Version func(Get) web.VersionResp `mir:"/"` diff --git a/mirc/web/v1/relax.go b/mirc/web/v1/relax.go index 3bdfdb91..c3829264 100644 --- a/mirc/web/v1/relax.go +++ b/mirc/web/v1/relax.go @@ -1,20 +1,15 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Relax]() -} - // Relax 放宽授权的服务 type Relax struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // GetUnreadMsgCount 获取当前用户未读消息数量 - GetUnreadMsgCount func(Get, Chain, web.GetUnreadMsgCountReq) web.GetUnreadMsgCountResp `mir:"/user/msgcount/unread"` + GetUnreadMsgCount func(Get, Chain, web.GetUnreadMsgCountReq) web.GetUnreadMsgCountResp `mir:"user/msgcount/unread"` } diff --git a/mirc/web/v1/site.go b/mirc/web/v1/site.go index ba8ca294..6633ad06 100644 --- a/mirc/web/v1/site.go +++ b/mirc/web/v1/site.go @@ -1,22 +1,18 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Site]() -} - // Site 站点本身相关的信息服务 type Site struct { - Group `mir:"v1"` + Schema `mir:"v1"` // Version 获取后台版本信息 - Version func(Get) web.VersionResp `mir:"/site/version"` + Version func(Get) web.VersionResp `mir:"site/version"` // Profile 站点配置概要信息 - Profile func(Get) web.SiteProfileResp `mir:"/site/profile"` + Profile func(Get) web.SiteProfileResp `mir:"site/profile"` } diff --git a/mirc/web/v1/trends.go b/mirc/web/v1/trends.go index c6bc0f91..77412dde 100644 --- a/mirc/web/v1/trends.go +++ b/mirc/web/v1/trends.go @@ -1,20 +1,15 @@ package v1 import ( - . "github.com/alimy/mir/v4" - . "github.com/alimy/mir/v4/engine" + . "github.com/alimy/mir/v5" + "github.com/rocboss/paopao-ce/internal/model/web" ) -func init() { - Entry[Trends]() -} - // Trends 动态相关 服务 type Trends struct { - Chain `mir:"-"` - Group `mir:"v1"` + Schema `mir:"v1,chain"` // GetIndexTrends 获取广场页面动态条栏的索引item - GetIndexTrends func(Get, web.GetIndexTrendsReq) web.GetIndexTrendsResp `mir:"/trends/index"` + GetIndexTrends func(Get, web.GetIndexTrendsReq) web.GetIndexTrendsResp `mir:"trends/index"` } diff --git a/pkg/xerror/xerror.go b/pkg/xerror/xerror.go index 2f8d01f2..249d0914 100644 --- a/pkg/xerror/xerror.go +++ b/pkg/xerror/xerror.go @@ -9,7 +9,7 @@ import ( "net/http" "strings" - "github.com/alimy/mir/v4" + "github.com/alimy/mir/v5" ) var (