From 56618ddd465c24c95934d346734c94067d1186d2 Mon Sep 17 00:00:00 2001 From: hawklin2017 <32898629+hawklin2017@users.noreply.github.com> Date: Thu, 7 May 2026 11:21:08 +0800 Subject: [PATCH] update --- internal/api/router.go | 33 ++++----------------------------- internal/rpc/relation/friend.go | 2 +- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/internal/api/router.go b/internal/api/router.go index af9c69aed..91866804d 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -12,7 +12,6 @@ import ( pbcrypto "github.com/openimsdk/protocol/crypto" "github.com/openimsdk/protocol/group" "github.com/openimsdk/protocol/msg" - pbredpacket "github.com/openimsdk/protocol/redpacket" "github.com/openimsdk/protocol/relation" "github.com/openimsdk/protocol/rtc" "github.com/openimsdk/protocol/third" @@ -118,10 +117,7 @@ func newGinRouter(ctx context.Context, client discovery.SvcDiscoveryRegistry, co if err != nil { return nil, err } - redpacketConn, err := client.GetConn(ctx, config.Share.RpcRegisterName.RedPacket) - if err != nil { - return nil, err - } + gin.SetMode(gin.ReleaseMode) r := gin.New() if v, ok := binding.Validator.Engine().(*validator.Validate); ok { @@ -249,6 +245,9 @@ func newGinRouter(ctx context.Context, client discovery.SvcDiscoveryRegistry, co groupRouterGroup.POST("/get_full_join_group_ids", g.GetFullJoinGroupIDs) groupRouterGroup.POST("/get_group_application_unhandled_count", g.GetGroupApplicationUnhandledCount) groupRouterGroup.POST("/get_common_groups_with_friend", g.GetCommonGroupsWithFriend) + groupRouterGroup.POST("/pin_group_message", g.PinGroupMessage) + groupRouterGroup.POST("/unpin_group_message", g.UnpinGroupMessage) + groupRouterGroup.POST("/get_group_pinned_messages", g.GetGroupPinnedMessages) } // certificate { @@ -369,30 +368,6 @@ func newGinRouter(ctx context.Context, client discovery.SvcDiscoveryRegistry, co cryptoGroup.POST("/integrity_report", cr.IntegrityReport) } - // RedPacket - { - rp := NewRedPacketApi(pbredpacket.NewRedPacketClient(redpacketConn)) - redpacketGroup := r.Group("/redpacket") - redpacketGroup.POST("/create_order", rp.CreateOrder) - redpacketGroup.POST("/created_callback", rp.CreatedCallback) - redpacketGroup.POST("/detail", rp.GetDetail) - redpacketGroup.POST("/issue_claim_sign", rp.IssueClaimSign) - redpacketGroup.POST("/claim_result", rp.ClaimResult) - redpacketGroup.POST("/request_refund", rp.RequestRefund) - redpacketGroup.POST("/get_refund", rp.GetRefund) - redpacketGroup.POST("/wallet_bind/challenge", rp.IssueWalletBindChallenge) - redpacketGroup.POST("/wallet_bind/confirm", rp.ConfirmWalletBind) - redpacketGroup.POST("/wallet_bind/detail", rp.GetWalletBinding) - - adminGroup := redpacketGroup.Group("/admin") - adminGroup.POST("/set_signer", rp.AdminSetSigner) - adminGroup.POST("/set_token", rp.AdminSetToken) - adminGroup.POST("/set_expiry", rp.AdminSetExpiry) - adminGroup.POST("/set_allow_all_tokens", rp.AdminSetAllowAllTokens) - adminGroup.POST("/set_native_token_enabled", rp.AdminSetNativeTokenEnabled) - adminGroup.POST("/parse_tx_events", rp.AdminParseTxEvents) - } - { statisticsGroup := r.Group("/statistics") statisticsGroup.POST("/user/register", u.UserRegisterCount) diff --git a/internal/rpc/relation/friend.go b/internal/rpc/relation/friend.go index 28417e61c..770158882 100644 --- a/internal/rpc/relation/friend.go +++ b/internal/rpc/relation/friend.go @@ -697,7 +697,7 @@ func (s *friendServer) AddOnewayFriend(ctx context.Context, req *relation.ApplyT if in1 { return nil, servererrs.ErrRelationshipAlready.WrapMsg("already in friend list") } - if err := s.db.BecomeOnewayFriend(ctx, req.FromUserID, req.ToUserID, becomeFriendByOneway); err != nil { + if err := s.db.BecomeOnewayFriend(ctx, req.FromUserID, req.ToUserID, becomeFriendByOneway, req.Remark); err != nil { return nil, err }