From b10d97117e3f8841b822ff4471846e758fd49cc4 Mon Sep 17 00:00:00 2001 From: zetaloop Date: Thu, 23 Apr 2026 16:29:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BA=E7=A7=BB=E9=99=A4=E6=89=93?= =?UTF-8?q?=E6=89=8B=E7=AB=AF=E7=82=B9=E4=BD=BF=E7=94=A8=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E7=9A=84=20path=20=E5=8F=82=E6=95=B0=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/shop/api/internal/handler/shop/removePlayerHandler.go | 2 +- app/shop/api/internal/logic/shop/removePlayerLogic.go | 2 +- app/shop/api/internal/types/types.go | 5 +++++ desc/api/shop.api | 6 +++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/shop/api/internal/handler/shop/removePlayerHandler.go b/app/shop/api/internal/handler/shop/removePlayerHandler.go index ba87605..de2da5c 100644 --- a/app/shop/api/internal/handler/shop/removePlayerHandler.go +++ b/app/shop/api/internal/handler/shop/removePlayerHandler.go @@ -15,7 +15,7 @@ import ( // 移除打手 func RemovePlayerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - var req types.InvitationReq + var req types.RemovePlayerReq if err := httpx.Parse(r, &req); err != nil { httpx.ErrorCtx(r.Context(), w, err) return diff --git a/app/shop/api/internal/logic/shop/removePlayerLogic.go b/app/shop/api/internal/logic/shop/removePlayerLogic.go index 1f02945..d3ff9f5 100644 --- a/app/shop/api/internal/logic/shop/removePlayerLogic.go +++ b/app/shop/api/internal/logic/shop/removePlayerLogic.go @@ -31,7 +31,7 @@ func NewRemovePlayerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Remo } } -func (l *RemovePlayerLogic) RemovePlayer(req *types.InvitationReq) (resp *types.EmptyResp, err error) { +func (l *RemovePlayerLogic) RemovePlayer(req *types.RemovePlayerReq) (resp *types.EmptyResp, err error) { userID, err := contextj.UserIDFrom(l.ctx) if err != nil { return nil, err diff --git a/app/shop/api/internal/types/types.go b/app/shop/api/internal/types/types.go index e58a005..dfe4ee6 100644 --- a/app/shop/api/internal/types/types.go +++ b/app/shop/api/internal/types/types.go @@ -51,6 +51,11 @@ type PageReq struct { Limit int64 `form:"limit,default=20"` } +type RemovePlayerReq struct { + Id int64 `path:"id"` + PlayerId int64 `path:"playerId"` +} + type ShopIdReq struct { Id int64 `path:"id"` } diff --git a/desc/api/shop.api b/desc/api/shop.api index 6bb9684..ae2a2b8 100644 --- a/desc/api/shop.api +++ b/desc/api/shop.api @@ -90,6 +90,10 @@ type ( Id int64 `path:"id"` index int64 `path:"index"` } + RemovePlayerReq { + Id int64 `path:"id"` + PlayerId int64 `path:"playerId"` + } AcceptInvitationReq { Id int64 `path:"id"` } @@ -158,7 +162,7 @@ service shop-api { @doc "移除打手" @handler RemovePlayer - delete /shops/:id/players/:playerId (InvitationReq) returns (EmptyResp) + delete /shops/:id/players/:playerId (RemovePlayerReq) returns (EmptyResp) @doc "获取收入统计" @handler GetShopIncomeStats